test_opener.html (2167B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <script src="/tests/SimpleTest/SimpleTest.js"></script> 5 <script src="/tests/SimpleTest/EventUtils.js"></script> 6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 7 <script type="text/javascript" src="NavigationUtils.js"></script> 8 <style type="text/css"> 9 iframe { width: 90%; height: 50px; } 10 </style> 11 <script> 12 if (navigator.platform.startsWith("Linux")) { 13 SimpleTest.expectAssertions(0, 1); 14 } 15 16 window.onload = async function() { 17 navigateByLocation(window0); 18 navigateByOpen("window1"); 19 navigateByForm("window2"); 20 navigateByHyperlink("window3"); 21 22 await waitForFinishedFrames(4); 23 await isNavigated(window0, "Should be able to navigate popup by setting location."); 24 await isNavigated(window1, "Should be able to navigate popup by calling window.open."); 25 await isNavigated(window2, "Should be able to navigate popup by submitting form."); 26 await isNavigated(window3, "Should be able to navigate popup by targeted hyperlink."); 27 28 window0.close(); 29 window1.close(); 30 window2.close(); 31 window3.close(); 32 33 await cleanupWindows(); 34 35 SimpleTest.finish(); 36 }; 37 38 // eslint-disable-next-line @microsoft/sdl/no-insecure-url 39 var window0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window0", "width=10,height=10"); 40 // eslint-disable-next-line @microsoft/sdl/no-insecure-url 41 var window1 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window1", "width=10,height=10"); 42 // eslint-disable-next-line @microsoft/sdl/no-insecure-url 43 var window2 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window2", "width=10,height=10"); 44 // eslint-disable-next-line @microsoft/sdl/no-insecure-url 45 var window3 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window3", "width=10,height=10"); 46 </script> 47 </head> 48 <body> 49 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=408052">Mozilla Bug 408052</a> 50 <pre id="test"> 51 <script type="text/javascript"> 52 SimpleTest.waitForExplicitFinish(); 53 </script> 54 </pre> 55 </body> 56 </html>