summaryrefslogtreecommitdiffstats
path: root/dom/security/test/csp/test_subframe_run_js_if_allowed.html
blob: ccc81a2656edbc872e2af34a037a818c4d8c2876 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=702439

This test verifies that child iframes of CSP documents are
permitted to execute javascript: URLs assuming the policy
allows this.
-->
<head>
  <title>Test for Bug 702439</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="i"></iframe>
<script class="testbody" type="text/javascript">
var javascript_link_ran = false;

// check that the script in the child frame's javascript: URL ran
function checkResult()
{
  is(javascript_link_ran, true,
     "javascript URL didn't execute");

  SimpleTest.finish();
}

SimpleTest.waitForExplicitFinish();
document.getElementById('i').src = 'file_subframe_run_js_if_allowed.html';
</script>
</body>
</html>