docshell/test/navigation/test_bug270414.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <!DOCTYPE html>
michael@0 2 <html>
michael@0 3 <head>
michael@0 4 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 5 <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
michael@0 6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
michael@0 7 <script type="text/javascript" src="NavigationUtils.js"></script>
michael@0 8 <style type="text/css">
michael@0 9 iframe { width: 90%; height: 50px; }
michael@0 10 </style>
michael@0 11 <script>
michael@0 12 var headerHTML = "<html><head>" +
michael@0 13 "<script src='/tests/SimpleTest/EventUtils.js'></scr" + "ipt>" +
michael@0 14 "<script src='NavigationUtils.js'></scr" + "ipt>" +
michael@0 15 "</head><body>";
michael@0 16 var footerHTML = "</body></html>";
michael@0 17
michael@0 18 function testChild0() {
michael@0 19 if (!window.window0) {
michael@0 20 window0 = window.open("", "window0", "width=10,height=10");
michael@0 21 window0.document.open();
michael@0 22 window0.document.write(headerHTML);
michael@0 23 window0.document.write("<script>navigateByLocation(opener.frames[0])</scr" + "ipt>");
michael@0 24 window0.document.write(footerHTML);
michael@0 25 window0.document.close();
michael@0 26 }
michael@0 27 }
michael@0 28
michael@0 29 function testChild1() {
michael@0 30 if (!window.window1) {
michael@0 31 window1 = window.open("", "window1", "width=10,height=10");
michael@0 32 window1.document.open();
michael@0 33 window1.document.write(headerHTML);
michael@0 34 window1.document.write("<script>navigateByOpen('child1');</scr" + "ipt>");
michael@0 35 window1.document.write(footerHTML);
michael@0 36 window1.document.close();
michael@0 37 }
michael@0 38 }
michael@0 39
michael@0 40 function testChild2() {
michael@0 41 if (!window.window2) {
michael@0 42 window2 = window.open("", "window2", "width=10,height=10");
michael@0 43 window2.document.open();
michael@0 44 window2.document.write(headerHTML);
michael@0 45 window2.document.write("<script>navigateByForm('child2');</scr" + "ipt>");
michael@0 46 window2.document.write(footerHTML);
michael@0 47 window2.document.close();
michael@0 48 }
michael@0 49 }
michael@0 50
michael@0 51 function testChild3() {
michael@0 52 if (!window.window3) {
michael@0 53 window3 = window.open("", "window3", "width=10,height=10");
michael@0 54 window3.document.open();
michael@0 55 window3.document.write(headerHTML);
michael@0 56 window3.document.write("<script>navigateByHyperlink('child3');</scr" + "ipt>");
michael@0 57 window3.document.write(footerHTML);
michael@0 58 window3.document.close();
michael@0 59 }
michael@0 60 }
michael@0 61
michael@0 62 xpcWaitForFinishedFrames(function() {
michael@0 63 isNavigated(frames[0], "Should be able to navigate on-domain opener's children by setting location.");
michael@0 64 isNavigated(frames[1], "Should be able to navigate on-domain opener's children by calling window.open.");
michael@0 65 isNavigated(frames[2], "Should be able to navigate on-domain opener's children by submitting form.");
michael@0 66 isNavigated(frames[3], "Should be able to navigate on-domain opener's children by targeted hyperlink.");
michael@0 67
michael@0 68 window0.close();
michael@0 69 window1.close();
michael@0 70 window2.close();
michael@0 71 window3.close();
michael@0 72
michael@0 73 xpcCleanupWindows();
michael@0 74 SimpleTest.finish();
michael@0 75 }, 4);
michael@0 76
michael@0 77 </script>
michael@0 78 </head>
michael@0 79 <body>
michael@0 80 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=270414">Mozilla Bug 270414</a>
michael@0 81 <div id="frames">
michael@0 82 <iframe onload="testChild0();" name="child0" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
michael@0 83 <iframe onload="testChild1();" name="child1" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
michael@0 84 <iframe onload="testChild2();" name="child2" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
michael@0 85 <iframe onload="testChild3();" name="child3" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
michael@0 86 </div>
michael@0 87 <pre id="test">
michael@0 88 <script type="text/javascript">
michael@0 89 SimpleTest.waitForExplicitFinish();
michael@0 90 </script>
michael@0 91 </pre>
michael@0 92 </body>
michael@0 93 </html>

mercurial