1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/test/csp/test_subframe_run_js_if_allowed.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,32 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=702439 1.8 + 1.9 +This test verifies that child iframes of CSP documents are 1.10 +permitted to execute javascript: URLs assuming the policy 1.11 +allows this. 1.12 +--> 1.13 +<head> 1.14 + <title>Test for Bug 702439</title> 1.15 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.16 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.17 +</head> 1.18 +<body> 1.19 +<script class="testbody" type="text/javascript"> 1.20 +var javascript_link_ran = false; 1.21 + 1.22 +// check that the script in the child frame's javascript: URL ran 1.23 +function checkResult() 1.24 +{ 1.25 + is(javascript_link_ran, true, 1.26 + "javascript URL didn't execute"); 1.27 + 1.28 + SimpleTest.finish(); 1.29 +} 1.30 + 1.31 +SimpleTest.waitForExplicitFinish(); 1.32 +</script> 1.33 +<iframe id="i" src="file_subframe_run_js_if_allowed.html"></iframe> 1.34 +</body> 1.35 +</html>