|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <script> |
|
5 function go() { |
|
6 is(SpecialPowers.wrap(window).location.toString(), location.toString(), "sanity"); |
|
7 ok("returnValue" in window && "dialogArguments" in window, "We are modal"); |
|
8 var iwin = document.getElementById('ifr').contentWindow; |
|
9 is(SpecialPowers.Cu.getClassName(iwin, /* aUnwrap = */ true), "Window", "Descendant frames should not be modal"); |
|
10 |
|
11 if (location.origin != "http://mochi.test:8888") { |
|
12 is(window.dialogArguments, undefined, |
|
13 "dialogArguments should be undefined cross-origin: " + location.origin); |
|
14 } |
|
15 |
|
16 window.returnValue = "rv: " + window.dialogArguments; |
|
17 |
|
18 // Allow for testing navigations in series. |
|
19 if (location.search == "") { |
|
20 window.close(); |
|
21 } else { |
|
22 var origins = location.search.split('?')[1].split(','); |
|
23 var newsearch = '?' + origins.splice(1).join(','); |
|
24 var newurl = location.toString().replace(location.origin, origins[0]) |
|
25 .replace(location.search, newsearch); |
|
26 location = newurl; |
|
27 } |
|
28 |
|
29 } |
|
30 </script> |
|
31 </head> |
|
32 <body onload="opener.postMessage('dosetup', '*');"> |
|
33 <iframe id="ifr"></iframe> |
|
34 </body> |
|
35 </html> |