content/base/test/csp/test_policyuri_async_fetch.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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>

mercurial