Index: LayoutTests/fast/events/menu-key-context-menu-position.html |
diff --git a/LayoutTests/fast/events/menu-key-context-menu-position.html b/LayoutTests/fast/events/menu-key-context-menu-position.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ef4d00c03c34f76cfefc7900c02453d55b7bdef0 |
--- /dev/null |
+++ b/LayoutTests/fast/events/menu-key-context-menu-position.html |
@@ -0,0 +1,31 @@ |
+<!DOCTYPE HTML> |
+<script src="../../resources/js-test.js"></script> |
+<script src="../dom/resources/event-sender-util.js"></script> |
+<script> |
+ var inputNode; |
+ var X,Y; |
+ var event; |
+ description('Verifies that when element is focused in frames then selection'+ |
+ ' by menu key, context menu should come on focused element. Succeeds if '+ |
+ 'context menu is coming on the focused element and event co-ordinates are'+ |
+ ' at center of the elements bounding box.'); |
+ function onEventInFrame(e) { |
+ event = e; |
+ shouldBe("event.target", "inputNode"); |
+ shouldBe("event.clientX", "X"); |
+ shouldBe("event.clientY", "Y"); |
+ } |
+ function runTest() { |
+ if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ if (!window.eventSender) |
+ return; |
+ inputNode = frames[0].document.getElementById("ex1"); |
+ var r = inputNode.getBoundingClientRect(); |
+ X = (r.left + r.right) / 2 |
+ Y = (r.top + r.bottom) / 2; |
+ inputNode.focus(); |
+ eventSender.keyDown("menu"); |
+ } |
+</script> |
+<iframe id="myframe" style="margin-top:50px" onload="runTest()" src="resources/menu-key-context-menu-position-frame.html"><iframe> |