1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/docshell/test/navigation/test_popup-navigates-children.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,62 @@ 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 +function testChild0() { 1.16 + if (!window.window0) 1.17 + window0 = window.open("navigate.html#opener.frames[0],location", "window0", "width=10,height=10"); 1.18 +} 1.19 + 1.20 +function testChild1() { 1.21 + if (!window.window1) 1.22 + window1 = window.open("navigate.html#child1,open", "window1", "width=10,height=10"); 1.23 +} 1.24 + 1.25 +function testChild2() { 1.26 + if (!window.window2) 1.27 + window2 = window.open("navigate.html#child2,form", "window2", "width=10,height=10"); 1.28 +} 1.29 + 1.30 +function testChild3() { 1.31 + if (!window.window3) 1.32 + window3 = window.open("navigate.html#child3,hyperlink", "window3", "width=10,height=10"); 1.33 +} 1.34 + 1.35 +xpcWaitForFinishedFrames(function() { 1.36 + isNavigated(frames[0], "Should be able to navigate on-domain opener's children by setting location."); 1.37 + isNavigated(frames[1], "Should be able to navigate on-domain opener's children by calling window.open."); 1.38 + isNavigated(frames[2], "Should be able to navigate on-domain opener's children by submitting form."); 1.39 + isNavigated(frames[3], "Should be able to navigate on-domain opener's children by targeted hyperlink."); 1.40 + 1.41 + window0.close(); 1.42 + window1.close(); 1.43 + window2.close(); 1.44 + window3.close(); 1.45 + 1.46 + xpcCleanupWindows(); 1.47 + SimpleTest.finish(); 1.48 +}, 4); 1.49 + 1.50 +</script> 1.51 +</head> 1.52 +<body> 1.53 +<div id="frames"> 1.54 +<iframe onload="testChild0()" name="child0" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe> 1.55 +<iframe onload="testChild1()" name="child1" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe> 1.56 +<iframe onload="testChild2()" name="child2" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe> 1.57 +<iframe onload="testChild3()" name="child3" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe> 1.58 +</div> 1.59 +<pre id="test"> 1.60 +<script type="text/javascript"> 1.61 +SimpleTest.waitForExplicitFinish(); 1.62 +</script> 1.63 +</pre> 1.64 +</body> 1.65 +</html>