Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / isolated-worlds-override-keystate.html
blobc033f36980eaad95b1bd7bc4eb8f94081b9a5f14
1 <!DOCTYPE html>
2 <script>
3 function test()
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.dumpNavigationPolicy();
8 testRunner.evaluateScriptInIsolatedWorld(1,
9 "window.addEventListener('keydown', function(event) {" +
10 " var mouseEvent = new MouseEvent('click', { ctrlKey: true, metaKey: true });" +
11 // event.code is something like Digit1, so code[5] gives the number.
12 " var link = document.getElementById('link' + event.code[5]);" +
13 " link.dispatchEvent(mouseEvent);" +
14 "});");
15 eventSender.keyDown("1");
16 eventSender.keyDown("2");
19 </script>
20 <body onload="test()">
21 <p>Tests that adding a ctrl modifier to a click on a link from an isolated world triggers a background tab.</p>
22 <a href="blank" id="link1">link</a>
23 <a href="blank2" id="link2" target="_blank">link</a>
24 </body>