docshell/test/navigation/test_bug270414.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/docshell/test/navigation/test_bug270414.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,93 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +<head>
     1.7 +    <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
     1.8 +    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     1.9 +    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.10 +    <script type="text/javascript" src="NavigationUtils.js"></script>        
    1.11 +    <style type="text/css">
    1.12 +      iframe { width: 90%; height: 50px; }
    1.13 +    </style>
    1.14 +<script>
    1.15 +var headerHTML = "<html><head>" +
    1.16 +                 "<script src='/tests/SimpleTest/EventUtils.js'></scr" + "ipt>" + 
    1.17 +                 "<script src='NavigationUtils.js'></scr" + "ipt>" +
    1.18 +                 "</head><body>";
    1.19 +var footerHTML = "</body></html>";
    1.20 +
    1.21 +function testChild0() {
    1.22 +  if (!window.window0) {
    1.23 +    window0 = window.open("", "window0", "width=10,height=10");
    1.24 +    window0.document.open();
    1.25 +    window0.document.write(headerHTML);
    1.26 +    window0.document.write("<script>navigateByLocation(opener.frames[0])</scr" + "ipt>");
    1.27 +    window0.document.write(footerHTML);
    1.28 +    window0.document.close();
    1.29 +  }
    1.30 +}
    1.31 +
    1.32 +function testChild1() {
    1.33 +  if (!window.window1) {
    1.34 +    window1 = window.open("", "window1", "width=10,height=10");
    1.35 +    window1.document.open();
    1.36 +    window1.document.write(headerHTML);
    1.37 +    window1.document.write("<script>navigateByOpen('child1');</scr" + "ipt>");
    1.38 +    window1.document.write(footerHTML);
    1.39 +    window1.document.close();
    1.40 +  }
    1.41 +}
    1.42 +
    1.43 +function testChild2() {
    1.44 +  if (!window.window2) {
    1.45 +    window2 = window.open("", "window2", "width=10,height=10");
    1.46 +    window2.document.open();
    1.47 +    window2.document.write(headerHTML);
    1.48 +    window2.document.write("<script>navigateByForm('child2');</scr" + "ipt>");
    1.49 +    window2.document.write(footerHTML);
    1.50 +    window2.document.close();
    1.51 +  }
    1.52 +}
    1.53 +
    1.54 +function testChild3() {
    1.55 +  if (!window.window3) {
    1.56 +    window3 = window.open("", "window3", "width=10,height=10");
    1.57 +    window3.document.open();
    1.58 +    window3.document.write(headerHTML);
    1.59 +    window3.document.write("<script>navigateByHyperlink('child3');</scr" + "ipt>");
    1.60 +    window3.document.write(footerHTML);
    1.61 +    window3.document.close();
    1.62 +  }
    1.63 +}
    1.64 +
    1.65 +xpcWaitForFinishedFrames(function() {
    1.66 +  isNavigated(frames[0], "Should be able to navigate on-domain opener's children by setting location.");
    1.67 +  isNavigated(frames[1], "Should be able to navigate on-domain opener's children by calling window.open.");
    1.68 +  isNavigated(frames[2], "Should be able to navigate on-domain opener's children by submitting form.");
    1.69 +  isNavigated(frames[3], "Should be able to navigate on-domain opener's children by targeted hyperlink.");
    1.70 +
    1.71 +  window0.close();
    1.72 +  window1.close();
    1.73 +  window2.close();
    1.74 +  window3.close();
    1.75 +
    1.76 +  xpcCleanupWindows();
    1.77 +  SimpleTest.finish();
    1.78 +}, 4);
    1.79 +
    1.80 +</script>
    1.81 +</head>
    1.82 +<body>
    1.83 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=270414">Mozilla Bug 270414</a>
    1.84 +<div id="frames">
    1.85 +<iframe onload="testChild0();" name="child0" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
    1.86 +<iframe onload="testChild1();" name="child1" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
    1.87 +<iframe onload="testChild2();" name="child2" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
    1.88 +<iframe onload="testChild3();" name="child3" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
    1.89 +</div>
    1.90 +<pre id="test">
    1.91 +<script type="text/javascript">
    1.92 +SimpleTest.waitForExplicitFinish();
    1.93 +</script>
    1.94 +</pre>
    1.95 +</body>
    1.96 +</html>

mercurial