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);" +
15 eventSender
.keyDown("1");
16 eventSender
.keyDown("2");
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>