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; |
| 7 var event; |
| 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 event = e; |
| 14 shouldBe("event.target", "inputNode"); |
| 15 shouldBe("event.clientX", "X"); |
| 16 shouldBe("event.clientY", "Y"); |
| 17 } |
| 18 function runTest() { |
| 19 if (window.testRunner) |
| 20 testRunner.dumpAsText(); |
| 21 if (!window.eventSender) |
| 22 return; |
| 23 inputNode = frames[0].document.getElementById("ex1"); |
| 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 <iframe id="myframe" style="margin-top:50px" onload="runTest()" src="resources/m
enu-key-context-menu-position-frame.html"><iframe> |
OLD | NEW |