docshell/test/navigation/test_opener.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 if (navigator.platform.startsWith("Linux")) {
michael@0 13 SimpleTest.expectAssertions(0, 1);
michael@0 14 }
michael@0 15
michael@0 16 window.onload = function () {
michael@0 17 navigateByLocation(window0);
michael@0 18 navigateByOpen("window1");
michael@0 19 navigateByForm("window2");
michael@0 20 navigateByHyperlink("window3");
michael@0 21
michael@0 22 xpcWaitForFinishedFrames(function() {
michael@0 23 isNavigated(window0, "Should be able to navigate popup by setting location.");
michael@0 24 isNavigated(window1, "Should be able to navigate popup by calling window.open.");
michael@0 25 isNavigated(window2, "Should be able to navigate popup by submitting form.");
michael@0 26 isNavigated(window3, "Should be able to navigate popup by targeted hyperlink.");
michael@0 27
michael@0 28 window0.close();
michael@0 29 window1.close();
michael@0 30 window2.close();
michael@0 31 window3.close();
michael@0 32
michael@0 33 xpcCleanupWindows();
michael@0 34 SimpleTest.finish();
michael@0 35 }, 4);
michael@0 36 }
michael@0 37
michael@0 38 var window0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window0", "width=10,height=10");
michael@0 39 var window1 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window1", "width=10,height=10");
michael@0 40 var window2 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window2", "width=10,height=10");
michael@0 41 var window3 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window3", "width=10,height=10");
michael@0 42 </script>
michael@0 43 </head>
michael@0 44 <body>
michael@0 45 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=408052">Mozilla Bug 408052</a>
michael@0 46 <pre id="test">
michael@0 47 <script type="text/javascript">
michael@0 48 SimpleTest.waitForExplicitFinish();
michael@0 49 </script>
michael@0 50 </pre>
michael@0 51 </body>
michael@0 52 </html>

mercurial