Bug 1316305 - Explicilty call .close() for websocket in test. r=baku
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Wed, 22 Mar 2017 13:04:02 +0100
changeset 348953 85e011992bf81c3c1c3d05614a44d14033d6bf4c
parent 348952 e27e769a70e317d0ce8c9cb69edcc0cc570134e4
child 348954 b6c3cdc5ac093906eafe2eb085cbf6352e260e59
push id31540
push userkwierso@gmail.com
push dateThu, 23 Mar 2017 00:10:08 +0000
treeherdermozilla-central@7513b3f42058 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1316305
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1316305 - Explicilty call .close() for websocket in test. r=baku
dom/security/test/csp/file_upgrade_insecure.html
dom/security/test/csp/file_upgrade_insecure_meta.html
--- a/dom/security/test/csp/file_upgrade_insecure.html
+++ b/dom/security/test/csp/file_upgrade_insecure.html
@@ -52,16 +52,17 @@
     var mySocket = new WebSocket("ws://example.com/tests/dom/security/test/csp/file_upgrade_insecure");
     mySocket.onopen = function(e) {
       if (mySocket.url.includes("wss://")) {
         window.parent.postMessage({result: "websocket-ok"}, "*");
       }
       else {
         window.parent.postMessage({result: "websocket-error"}, "*");
       }
+      mySocket.close();
     };
     mySocket.onerror = function(e) {
       // debug information for Bug 1316305
       dump("  xxx mySocket.onerror: (mySocket): " + mySocket + "\n");
       dump("  xxx mySocket.onerror: (mySocket.url): " + mySocket.url + "\n");
       dump("  xxx mySocket.onerror: (e): " + e + "\n");
       dump("  xxx mySocket.onerror: (e.message): " + e.message + "\n");
       window.parent.postMessage({result: "websocket-unexpected-error"}, "*");
--- a/dom/security/test/csp/file_upgrade_insecure_meta.html
+++ b/dom/security/test/csp/file_upgrade_insecure_meta.html
@@ -53,16 +53,17 @@
     var mySocket = new WebSocket("ws://example.com/tests/dom/security/test/csp/file_upgrade_insecure");
     mySocket.onopen = function(e) {
       if (mySocket.url.includes("wss://")) {
         window.parent.postMessage({result: "websocket-ok"}, "*");
       }
       else {
         window.parent.postMessage({result: "websocket-error"}, "*");
       }
+      mySocket.close();
     };
     mySocket.onerror = function(e) {
       window.parent.postMessage({result: "websocket-unexpected-error"}, "*");
     };
   </script>
 
   <!-- form action: (upgrade POST from http:// to https://) -->
   <iframe name='formFrame' id='formFrame'></iframe>