docshell/test/navigation/test_bug278916.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/docshell/test/navigation/test_bug278916.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     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 +<script>
    1.12 +window.onload = function () {
    1.13 +  document.getElementById("link0").href = target_url;
    1.14 +  sendMouseEvent({type:"click"}, "link0");
    1.15 +  
    1.16 +  xpcWaitForFinishedFrames(function() {
    1.17 +    var array_of_frames = xpcGetFramesByName("window0");
    1.18 +    is(array_of_frames.length, 1, "Should only open one window using a fancy hyperlink.");
    1.19 +
    1.20 +    for (var i=0; i < array_of_frames.length; ++i)
    1.21 +      array_of_frames[i].close();
    1.22 +
    1.23 +    xpcCleanupWindows();
    1.24 +    SimpleTest.finish();
    1.25 +  }, 1);
    1.26 +}
    1.27 +</script>
    1.28 +</head>
    1.29 +<body>
    1.30 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=278916">Mozilla Bug 278916</a>
    1.31 +<div id="links">
    1.32 +<a id="link0" target="window0" onclick="window.open('', 'window0', 'width=10,height=10');">This is a fancy hyperlink</a>
    1.33 +</div>
    1.34 +<pre id="test">
    1.35 +<script type="text/javascript">
    1.36 +SimpleTest.waitForExplicitFinish();
    1.37 +</script>
    1.38 +</pre>
    1.39 +</body>
    1.40 +</html>

mercurial