OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script> | |
4 function runTests() | |
5 { | |
6 window.onfocus = onFocusFunc; | |
7 window.onblur = onBlurFunc; | |
8 if (window.testRunner) { | |
9 testRunner.dumpAsText(); | |
10 testRunner.setCanOpenWindows(); | |
11 testRunner.waitUntilDone(); | |
12 | |
13 // DumpRenderTreeWindow does not respond to focus events. Forcing o
nblur event so | |
14 // that the results matches what you'll see in the browser. | |
15 testRunner.setWindowIsKey(false); | |
16 } | |
17 showModalDialog("resources/modal-dialog.html"); | |
18 } | |
19 | |
20 function log(message) | |
21 { | |
22 var console = document.getElementById("console"); | |
23 var li = document.createElement("li"); | |
24 var text = document.createTextNode(message); | |
25 | |
26 console.appendChild(li); | |
27 li.appendChild(text); | |
28 } | |
29 | |
30 function onBlurFunc() | |
31 { | |
32 log("onblur fired. Should see this exactly once."); | |
33 } | |
34 | |
35 function onFocusFunc() | |
36 { | |
37 log("ERROR: onfocus fired."); | |
38 } | |
39 </script> | |
40 </head> | |
41 | |
42 <body onload="runTests()"> | |
43 <p>Pop up a modal dialog. Verifies that focus events are not fired while in
side the message loop.</p><br/> | |
44 <p>You need to disable pop-up blocker for this test to run successfully in t
he browser.</p> | |
45 <ul id="console"></ul> | |
46 </body> | |
47 </html> | |
OLD | NEW |