| <!DOCTYPE html> |
| <html> |
| <head> |
| <script> |
| function runTest() { |
| window.onfocus = windowFocused; |
| window.onblur = windowBlurred; |
| |
| if (window.testRunner) { |
| testRunner.waitUntilDone(); |
| testRunner.dumpAsText(); |
| testRunner.setWindowIsKey(false); |
| window.open('javascript:window.focus()', '_self', ''); |
| setTimeout(function() { testRunner.notifyDone(); }, 0); |
| } |
| } |
| |
| function log(message) { |
| var console = document.getElementById("console"); |
| var li = document.createElement("li"); |
| var text = document.createTextNode(message); |
| |
| console.appendChild(li); |
| li.appendChild(text); |
| } |
| |
| function windowFocused() { |
| log("FAIL: Window was focused"); |
| } |
| |
| function windowBlurred() { |
| log("Window was blurred"); |
| } |
| </script> |
| </head> |
| <body> |
| This tests that a window cannot focus itself by using javascript: urls. |
| <ul id="console"></ul> |
| <script>runTest();</script> |
| </body> |
| </html> |