1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/test/test_bug907892.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,49 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=907892 1.8 +--> 1.9 +<head> 1.10 + <meta charset="utf-8"> 1.11 + <title>Test for Bug 907892</title> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.14 + <script type="application/javascript"> 1.15 + 1.16 + /** Test for Bug 907892 **/ 1.17 + SimpleTest.waitForExplicitFinish(); 1.18 + 1.19 + var expectedMessages = 2; 1.20 + window.onmessage = function (ev) { 1.21 + if (ev.data.sandboxed) { 1.22 + ok(ev.data.threw, 1.23 + "Should have thrown when setting document.domain in sandboxed iframe"); 1.24 + } else { 1.25 + ok(!ev.data.threw, 1.26 + "Should not have thrown when setting document.domain in iframe"); 1.27 + } 1.28 + 1.29 + --expectedMessages; 1.30 + if (expectedMessages == 0) { 1.31 + SimpleTest.finish(); 1.32 + } 1.33 + }; 1.34 + </script> 1.35 +</head> 1.36 +<body> 1.37 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=907892">Mozilla Bug 907892</a> 1.38 +<p id="display"></p> 1.39 +<div id="content" style="display: none"> 1.40 +<!-- Set all the sandbox flags to "allow" to make sure we cover that case --> 1.41 +<iframe 1.42 + sandbox="allow-same-origin allow-scripts allow-forms allow-top-navigation alllow-pointer-lock" 1.43 + src="http://test1.example.org/tests/content/base/test/file_bug907892.html?sandboxed"> 1.44 +</iframe> 1.45 +<iframe 1.46 + src="http://test1.example.org/tests/content/base/test/file_bug907892.html?normal"> 1.47 +</iframe> 1.48 +</div> 1.49 +<pre id="test"> 1.50 +</pre> 1.51 +</body> 1.52 +</html>