docshell/test/navigation/test_popup-navigates-children.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!DOCTYPE html>
     2 <html>
     3 <head>
     4     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
     5     <script type="text/javascript" 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 function testChild0() {
    13   if (!window.window0)
    14     window0 = window.open("navigate.html#opener.frames[0],location", "window0", "width=10,height=10");
    15 }
    17 function testChild1() {
    18   if (!window.window1)
    19     window1 = window.open("navigate.html#child1,open", "window1", "width=10,height=10");
    20 }
    22 function testChild2() {
    23   if (!window.window2)
    24     window2 = window.open("navigate.html#child2,form", "window2", "width=10,height=10");
    25 }
    27 function testChild3() {
    28   if (!window.window3)
    29     window3 = window.open("navigate.html#child3,hyperlink", "window3", "width=10,height=10");
    30 }
    32 xpcWaitForFinishedFrames(function() {
    33   isNavigated(frames[0], "Should be able to navigate on-domain opener's children by setting location.");
    34   isNavigated(frames[1], "Should be able to navigate on-domain opener's children by calling window.open.");
    35   isNavigated(frames[2], "Should be able to navigate on-domain opener's children by submitting form.");
    36   isNavigated(frames[3], "Should be able to navigate on-domain opener's children by targeted hyperlink.");
    38   window0.close();
    39   window1.close();
    40   window2.close();
    41   window3.close();
    43   xpcCleanupWindows();
    44   SimpleTest.finish();
    45 }, 4);
    47 </script>
    48 </head>
    49 <body>
    50 <div id="frames">
    51 <iframe onload="testChild0()" name="child0" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
    52 <iframe onload="testChild1()" name="child1" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
    53 <iframe onload="testChild2()" name="child2" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
    54 <iframe onload="testChild3()" name="child3" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
    55 </div>
    56 <pre id="test">
    57 <script type="text/javascript">
    58 SimpleTest.waitForExplicitFinish();
    59 </script>
    60 </pre>
    61 </body>
    62 </html>

mercurial