6 window.onfocus = onFocusFunc;
7 window.onblur = onBlurFunc;
8 if (window.testRunner) {
9 testRunner.dumpAsText();
10 testRunner.setCanOpenWindows();
11 testRunner.waitUntilDone();
13 // DumpRenderTreeWindow does not respond to focus events. Forcing onblur event so
14 // that the results matches what you'll see in the browser.
15 testRunner.setWindowIsKey(false);
17 showModalDialog("resources/modal-dialog.html");
22 var console = document.getElementById("console");
23 var li = document.createElement("li");
24 var text = document.createTextNode(message);
26 console.appendChild(li);
32 log("onblur fired. Should see this exactly once.");
35 function onFocusFunc()
37 log("ERROR: onfocus fired.");
42 <body onload="runTests()">
43 <p>Pop up a modal dialog. Verifies that focus events are not fired while inside the message loop.</p><br/>
44 <p>You need to disable pop-up blocker for this test to run successfully in the browser.</p>
45 <ul id="console"></ul>