Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=558431
5 -->
6 <head>
7 <title>Test for Bug 558431</title>
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
10 </head>
11 <body>
12 <iframe id="cspframe"></iframe>
13 <script type="text/javascript">
14 // This tests that a policy is still attempted to be fetched
15 // asynchronously (bug 558431) and that a default policy of
16 // |allow 'none'| is applied when the fetching fails.
18 var f = document.getElementById("cspframe");
19 // run our test functions when the inner frame is finished loading
20 f.addEventListener('load', function() {
21 var inner = this.contentDocument.getElementById("inner");
22 var test = inner.contentDocument.getElementById("test");
23 // the inner document should not exist because it has an invalid
24 // policy-uri and should have been blocked by the default
25 // |allow 'none'| policy that was applied
26 is(test, null, "test inner document");
27 SimpleTest.finish();
28 }, false);
29 // load the test frame
30 f.src = "file_policyuri_async_fetch.html";
31 SimpleTest.waitForExplicitFinish();
32 </script>
33 </body>
34 </html>