Backed out changeset b9aecc2e6334 (bug 1234813) for test failures in connect-src-beacon-blocked.sub.html
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 11 Feb 2016 11:33:06 +0100
changeset 320289 ea9d3fffab4600a3d8652692581bff0ce02b4473
parent 320288 47f2ca683d379b02fb55ecd6ded03f258436da66
child 320290 7d7b25df9fe88961e5b1c4ce04c6d8a306f284c6
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1234813
milestone47.0a1
backs outb9aecc2e6334a47faf1435bdd9abfc33713f58fd
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
Backed out changeset b9aecc2e6334 (bug 1234813) for test failures in connect-src-beacon-blocked.sub.html
dom/security/test/csp/file_main.js
dom/security/test/csp/file_sendbeacon.html
dom/security/test/csp/mochitest.ini
dom/security/test/csp/test_sendbeacon.html
--- a/dom/security/test/csp/file_main.js
+++ b/dom/security/test/csp/file_main.js
@@ -6,17 +6,20 @@ function doXHR(uri) {
   } catch(ex) {}
 }
 
 doXHR("http://mochi.test:8888/tests/dom/security/test/csp/file_CSP.sjs?testid=xhr_good");
 doXHR("http://example.com/tests/dom/security/test/csp/file_CSP.sjs?testid=xhr_bad");
 fetch("http://mochi.test:8888/tests/dom/security/test/csp/file_CSP.sjs?testid=fetch_good");
 fetch("http://example.com/tests/dom/security/test/csp/file_CSP.sjs?testid=fetch_bad");
 navigator.sendBeacon("http://mochi.test:8888/tests/dom/security/test/csp/file_CSP.sjs?testid=beacon_good");
-navigator.sendBeacon("http://example.com/tests/dom/security/test/csp/file_CSP.sjs?testid=beacon_bad");
+try {
+  navigator.sendBeacon("http://example.com/tests/dom/security/test/csp/file_CSP.sjs?testid=beacon_bad");
+} catch(ex) {}
+
 
 new Worker("file_main_worker.js").postMessage({inherited : false});
 
 
 var blobxhr = new XMLHttpRequest();
 blobxhr.open("GET", "file_main_worker.js")
 blobxhr.responseType = "blob";
 blobxhr.send();
deleted file mode 100644
--- a/dom/security/test/csp/file_sendbeacon.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset="utf-8">
-  <meta http-equiv="Content-Security-Policy" content= "connect-src 'none'">
-  <title>Bug 1234813 - sendBeacon should not throw if blocked by Content Policy</title>
-</head>
-<body>
-
-<script type="application/javascript">
-try {
-  navigator.sendBeacon("http://example.com/sendbeaconintonirvana");
-  window.parent.postMessage({result: "blocked-beacon-does-not-throw"}, "*");
-  }
-  catch (e) {
-    window.parent.postMessage({result: "blocked-beacon-throws"}, "*");
-  }
-</script>
-
-</body>
-</html>
--- a/dom/security/test/csp/mochitest.ini
+++ b/dom/security/test/csp/mochitest.ini
@@ -148,17 +148,16 @@ support-files =
   file_redirect_worker.sjs
   file_meta_element.html
   file_meta_header_dual.sjs
   file_docwrite_meta.html
   file_doccomment_meta.html
   file_docwrite_meta.css
   file_docwrite_meta.js
   file_multipart_testserver.sjs
-  file_sendbeacon.html
 
 [test_base-uri.html]
 [test_blob_data_schemes.html]
 [test_connect-src.html]
 [test_CSP.html]
 [test_allow_https_schemes.html]
 skip-if = buildapp == 'b2g' #no ssl support
 [test_bug663567.html]
@@ -225,9 +224,8 @@ skip-if = buildapp == 'b2g' #no ssl supp
 skip-if = buildapp == 'b2g' #investigate in bug 1222904
 [test_child-src_worker_data.html]
 [test_child-src_worker-redirect.html]
 [test_child-src_iframe.html]
 [test_meta_element.html]
 [test_meta_header_dual.html]
 [test_docwrite_meta.html]
 [test_multipartchannel.html]
-[test_sendbeacon.html]
deleted file mode 100644
--- a/dom/security/test/csp/test_sendbeacon.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>Bug 1234813 - sendBeacon should not throw if blocked by Content Policy</title>
-  <!-- Including SimpleTest.js so we can use waitForExplicitFinish !-->
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-<iframe style="width:100%;" id="testframe" src="file_sendbeacon.html"></iframe>
-
-<script class="testbody" type="text/javascript">
-
-/* Description of the test:
- * Let's try to fire a sendBeacon which gets blocked by CSP. Let's make sure
- * sendBeacon does not throw an exception.
- */
-SimpleTest.waitForExplicitFinish();
-
-// a postMessage handler used to bubble up the
-// result from within the iframe.
-window.addEventListener("message", receiveMessage, false);
-function receiveMessage(event) {
-  var result = event.data.result;
-  is(result, "blocked-beacon-does-not-throw", "sendBeacon should not throw");
-  window.removeEventListener("message", receiveMessage, false);
-  SimpleTest.finish();
-}
-
-</script>
-</body>
-</html>