Bug 1686668 [wpt PR 27185] - Update wpt metadata, a=testonly
[gecko.git] / dom / base / test / test_bug753278.html
blobe65cd6c34613c0f5a42e7f600080d396d97bf1d0
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=753278
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 753278</title>
9 <script src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 </head>
12 <body onload="runTest();">
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=753278">Mozilla Bug 753278</a>
14 <p id="display"></p>
15 <div id="content" style="display: none">
16 <iframe></iframe>
17 </div>
18 <pre id="test">
19 <script type="application/javascript">
21 /** Test for Bug 753278 **/
23 SimpleTest.waitForExplicitFinish();
25 var f = document.getElementsByTagName("iframe")[0];
27 function runTest() {
28 f.contentDocument.open();
29 f.contentDocument.write('<script>window.location = "file_bug753278.html"; document.close(); document.open(); document.write("\\u003Cscript>parent.fail();\\u003C/script>"); document.close();\u003c/script>');
30 f.contentDocument.close();
33 function pass() {
34 ok(true, "window.location took precedence");
35 SimpleTest.finish();
38 function fail() {
39 ok(false, "window.location should have taken precedence");
40 SimpleTest.finish();
43 </script>
44 </pre>
45 </body>
46 </html>