Backed out changeset b9aecc2e6334 (bug 1234813) for test failures in connect-src-beacon-blocked.sub.html

This commit is contained in:
Carsten "Tomcat" Book 2016-02-11 11:33:06 +01:00
parent dfef659a8c
commit 5aaf7f18ae
4 changed files with 4 additions and 58 deletions

View File

@ -11,7 +11,10 @@ doXHR("http://example.com/tests/dom/security/test/csp/file_CSP.sjs?testid=xhr_ba
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});

View File

@ -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>

View File

@ -153,7 +153,6 @@ support-files =
file_docwrite_meta.css
file_docwrite_meta.js
file_multipart_testserver.sjs
file_sendbeacon.html
[test_base-uri.html]
[test_blob_data_schemes.html]
@ -230,4 +229,3 @@ skip-if = buildapp == 'b2g' #investigate in bug 1222904
[test_meta_header_dual.html]
[test_docwrite_meta.html]
[test_multipartchannel.html]
[test_sendbeacon.html]

View File

@ -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>