Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE HTML> | |
| 2 <script src="../../resources/js-test.js"></script> | |
| 3 <script src="../dom/resources/event-sender-util.js"></script> | |
| 4 <script> | |
| 5 var inputNode; | |
| 6 var X,Y, clientX, clientY; | |
| 7 description('Verifies that when element is focused in frames then selection'+ | |
| 8 ' by menu key, context menu should come on focused element. Succeeds if '+ | |
| 9 'context menu is coming on the focused element and event co-ordinates are'+ | |
| 10 ' at center of the elements bounding box.'); | |
| 11 function onEventInFrame(event) { | |
| 12 shouldBe(event.target.id, 'inputNode'); | |
|
Rick Byers
2015/01/07 16:57:34
this should be a string as well. Remember the arg
Deepak
2015/01/08 10:11:28
Done.
Deepak
2015/01/08 10:11:29
Done.
| |
| 13 clientX = event.clientX; | |
| 14 clientY = event.clientY; | |
| 15 shouldBe("clientX","X"); | |
| 16 shouldBe("clientY","Y"); | |
| 17 } | |
| 18 function runTest() { | |
| 19 if (window.testRunner) | |
| 20 testRunner.dumpAsText(); | |
| 21 if (!window.eventSender) | |
| 22 return; | |
| 23 inputNode = frames[1].document.getElementById("inputNode"); | |
| 24 var r = inputNode.getBoundingClientRect(); | |
| 25 X = (r.left + r.right) / 2 | |
| 26 Y = (r.top + r.bottom) / 2; | |
| 27 inputNode.focus(); | |
| 28 eventSender.keyDown("menu"); | |
| 29 } | |
| 30 </script> | |
| 31 <body> | |
|
Rick Byers
2015/01/07 16:57:34
nit: no need for a body tag: http://www.chromium.o
Deepak
2015/01/08 10:11:29
Done.
| |
| 32 <iframe src="resources/window-opened.html"></iframe> | |
|
Rick Byers
2015/01/07 16:57:34
what is this other iframe for? You can probably r
Deepak
2015/01/08 10:11:28
Done.
| |
| 33 <iframe id="myframe" style="margin-top:50px" onload="runTest()" src="resources /menu-key-context-menu-position-frame.html"><iframe> | |
| 34 </body> | |
| OLD | NEW |