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
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <meta charset="utf-8"> |
michael@0 | 5 | <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
michael@0 | 6 | </head> |
michael@0 | 7 | <script type="text/javascript"> |
michael@0 | 8 | function ok(result, desc) { |
michael@0 | 9 | window.parent.postMessage({ok: result, desc: desc}, "*"); |
michael@0 | 10 | } |
michael@0 | 11 | |
michael@0 | 12 | function doStuff() { |
michael@0 | 13 | ok(true, "documents sandboxed with allow-scripts should be able to run inline scripts"); |
michael@0 | 14 | |
michael@0 | 15 | document.getElementById('a_form').submit(); |
michael@0 | 16 | |
michael@0 | 17 | // trigger the javascript: url test |
michael@0 | 18 | sendMouseEvent({type:'click'}, 'a_link'); |
michael@0 | 19 | } |
michael@0 | 20 | </script> |
michael@0 | 21 | <script src='file_iframe_sandbox_pass.js'></script> |
michael@0 | 22 | <body onLoad='ok(true, "documents sandboxed with allow-scripts should be able to run script from event listeners");doStuff();'> |
michael@0 | 23 | I am sandboxed but with "allow-scripts" |
michael@0 | 24 | <img src="http://example.org/tests/content/base/test/csp/file_CSP.sjs?testid=img6_bad&type=img/png"> </img> |
michael@0 | 25 | <script src='http://example.org/tests/content/base/test/csp/file_CSP.sjs?testid=script6_bad&type=text/javascript'></script> |
michael@0 | 26 | |
michael@0 | 27 | <form method="get" action="file_iframe_sandbox_form_fail.html" id="a_form"> |
michael@0 | 28 | First name: <input type="text" name="firstname"> |
michael@0 | 29 | Last name: <input type="text" name="lastname"> |
michael@0 | 30 | <input type="submit" onclick="doSubmit()" id="a_button"> |
michael@0 | 31 | </form> |
michael@0 | 32 | |
michael@0 | 33 | <a href = 'javascript:ok(true, "documents sandboxed with allow-scripts should be able to run script from javascript: URLs");' id='a_link'>click me</a> |
michael@0 | 34 | </body> |
michael@0 | 35 | </html> |