content/base/test/csp/test_policyuri_async_fetch.html
author Garrett Robinson <grobinson@mozilla.com>
Wed, 04 Jun 2014 17:53:58 -0700
changeset 207033 9a9020972cc49338612f54b908d224cf2f04847a
parent 207020 content/base/test/xcsp/test_policyuri_async_fetch.html@d9a7b9a18ab4759a96e7a726e4a403ebda6ca0f0
child 207263 413ea58159cf6b333798351ba1824122d98eb5cc
permissions -rw-r--r--
Backed out changeset d9a7b9a18ab4 (Bug 988616) on a CLOSED TREE

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=558431
-->
<head>
  <title>Test for Bug 558431</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<iframe id="cspframe"></iframe>
<script type="text/javascript">
// This tests that a policy is still attempted to be fetched
// asynchronously (bug 558431) and that a default policy of
// |allow 'none'| is applied when the fetching fails.

var f = document.getElementById("cspframe");
// run our test functions when the inner frame is finished loading
f.addEventListener('load', function() {
  var inner = this.contentDocument.getElementById("inner");
  var test = inner.contentDocument.getElementById("test");
  // the inner document should not exist because it has an invalid
  // policy-uri and should have been blocked by the default
  // |allow 'none'| policy that was applied
  is(test, null, "test inner document");
  SimpleTest.finish();
}, false);
// load the test frame
f.src = "file_policyuri_async_fetch.html";
SimpleTest.waitForExplicitFinish();
</script>
</body>
</html>