|
1 <html> |
|
2 <body> |
|
3 <script> |
|
4 |
|
5 // Because this file is inside <iframe mozbrowser>, the alert() calls below |
|
6 // don't trigger actual dialogs. Instead, the document which contans the |
|
7 // iframe receives mozbrowsershowmodalprompt events, which the document uses |
|
8 // to determine test success/failure. |
|
9 |
|
10 function is(x, y, reason) { |
|
11 if (x === y) { |
|
12 alert("success: " + x + " === " + y + ", " + reason); |
|
13 } |
|
14 else { |
|
15 alert("failure: " + x + " !== " + y + ", " + reason); |
|
16 } |
|
17 } |
|
18 |
|
19 function ok(bool, reason) { |
|
20 alert((bool ? "success: " : "failure: ") + reason); |
|
21 } |
|
22 |
|
23 // Send "dialog=1" as a test for bug 783644. It shouldn't have any effect. |
|
24 var w = window.open("file_browserElement_Open2.html", "name", "dialog=1"); |
|
25 w.addEventListener("load", function() { |
|
26 ok(true, "got load"); |
|
27 is(w.opener, window, 'opener property'); |
|
28 is(w.location.href, location.href.replace('Open1', 'Open2'), 'correct location'); |
|
29 is(w.document.getElementById('testElem').innerHTML, 'test', 'elem innerHTML'); |
|
30 alert("finish"); |
|
31 }); |
|
32 </script> |
|
33 </body> |
|
34 </html> |