Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE HTML> | |
| 2 <body> | |
| 3 <script src="../../resources/js-test.js"></script> | |
| 4 <script src="../dom/resources/event-sender-util.js"></script> | |
| 5 <script> | |
| 6 var anchorNode; | |
| 7 var x,y; | |
| 8 description('Verifies that when element is focused in frames then selection'+ | |
| 9 ' by menu key, context menu should come on focused element. Succeeds if '+ | |
| 10 'context menu is coming on the focused element and event co-ordinates are'+ | |
| 11 ' at center of the elements bounding box.'); | |
| 12 function onEventInFrame(e) { | |
| 13 shouldBe(e.target, anchorNode); | |
|
Rick Byers
2015/01/05 18:16:24
shouldBe takes expression strings to be evaluated,
Deepak
2015/01/06 13:27:02
Earlier the issue is we can not use frameset insid
| |
| 14 shouldBe(e.clientX, x); | |
| 15 shouldBe(e.clientY, y); | |
| 16 } | |
| 17 function runTest() { | |
| 18 if (window.testRunner) | |
| 19 testRunner.dumpAsText(); | |
| 20 if (!window.eventSender) | |
| 21 return; | |
| 22 anchorNode = frames[1].document.getElementById("ex1"); | |
| 23 var r = anchorNode.getBoundingClientRect(); | |
| 24 x = (r.left + r.right) / 2 | |
| 25 y = (r.top + r.bottom) / 2; | |
| 26 anchorNode.focus(); | |
| 27 eventSender.keyDown("menu"); | |
| 28 } | |
| 29 </script> | |
| 30 <frameset rows="30%,40%" onload="runTest()"> | |
| 31 <frame src="resources/window-opened.html"> | |
| 32 <frame id="myframe" src="resources/menu-key-context-menu-position-frame.html"> | |
| 33 </frameset> | |
| 34 </body> | |
| OLD | NEW |