6 window
.onfocus
= windowFocused
;
7 window
.onblur
= windowBlurred
;
9 if (window
.testRunner
) {
10 testRunner
.waitUntilDone();
11 testRunner
.dumpAsText();
12 testRunner
.setWindowIsKey(false);
13 window
.open('javascript:window.focus()', '_self', '');
14 setTimeout(function() { testRunner
.notifyDone(); }, 0);
18 function log(message
) {
19 var console
= document
.getElementById("console");
20 var li
= document
.createElement("li");
21 var text
= document
.createTextNode(message
);
23 console
.appendChild(li
);
27 function windowFocused() {
28 log("FAIL: Window was focused");
31 function windowBlurred() {
32 log("Window was blurred");
37 This tests that a window cannot focus itself by using javascript: urls.
38 <ul id=
"console"></ul>
39 <script>runTest();</script>