|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=907892 |
|
5 --> |
|
6 <head> |
|
7 <meta charset="utf-8"> |
|
8 <title>Test for Bug 907892</title> |
|
9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
11 <script type="application/javascript"> |
|
12 |
|
13 /** Test for Bug 907892 **/ |
|
14 SimpleTest.waitForExplicitFinish(); |
|
15 |
|
16 var expectedMessages = 2; |
|
17 window.onmessage = function (ev) { |
|
18 if (ev.data.sandboxed) { |
|
19 ok(ev.data.threw, |
|
20 "Should have thrown when setting document.domain in sandboxed iframe"); |
|
21 } else { |
|
22 ok(!ev.data.threw, |
|
23 "Should not have thrown when setting document.domain in iframe"); |
|
24 } |
|
25 |
|
26 --expectedMessages; |
|
27 if (expectedMessages == 0) { |
|
28 SimpleTest.finish(); |
|
29 } |
|
30 }; |
|
31 </script> |
|
32 </head> |
|
33 <body> |
|
34 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=907892">Mozilla Bug 907892</a> |
|
35 <p id="display"></p> |
|
36 <div id="content" style="display: none"> |
|
37 <!-- Set all the sandbox flags to "allow" to make sure we cover that case --> |
|
38 <iframe |
|
39 sandbox="allow-same-origin allow-scripts allow-forms allow-top-navigation alllow-pointer-lock" |
|
40 src="http://test1.example.org/tests/content/base/test/file_bug907892.html?sandboxed"> |
|
41 </iframe> |
|
42 <iframe |
|
43 src="http://test1.example.org/tests/content/base/test/file_bug907892.html?normal"> |
|
44 </iframe> |
|
45 </div> |
|
46 <pre id="test"> |
|
47 </pre> |
|
48 </body> |
|
49 </html> |