summaryrefslogtreecommitdiffstats
path: root/dom/base/test/test_window_focus_by_close_and_open.html
blob: d9b833c26f2a7ffce60a31f043d40b17c83dd3db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>test for window focus by window.close() and window.open()</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
<script>
SimpleTest.waitForExplicitFinish();

function start() {
  var w = window.open("", "_blank");
  w.finished = function() {
    ok(true, "1st new window had focus");
    w.close();
    w = window.open("", "_blank");
    w.finished = function() {
      ok(true, "2nd new window had focus");
      w.close();
      SimpleTest.finish();
    };
    w.location = "file_window_focus_by_close_and_open.html";
  };
  w.location = "file_window_focus_by_close_and_open.html";
}
</script>
</head>
<body onload="setTimeout(start)">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1695135">Mozilla Bug 1695135</a>
<p id="display"></p>
<div id="content"></div>
<pre id="test"></pre>
</body>
</html>