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..5cdccdf2e4df95beb860ea1914068143c32e6d4c |
--- /dev/null |
+++ b/LayoutTests/fast/events/menu-key-context-menu-position.html |
@@ -0,0 +1,34 @@ |
+<!DOCTYPE HTML> |
+<body> |
+<script src="../../resources/js-test.js"></script> |
+<script src="../dom/resources/event-sender-util.js"></script> |
+<script> |
+ var anchorNode; |
+ var x,y; |
+ 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) { |
+ 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
|
+ shouldBe(e.clientX, x); |
+ shouldBe(e.clientY, y); |
+ } |
+ function runTest() { |
+ if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ if (!window.eventSender) |
+ return; |
+ anchorNode = frames[1].document.getElementById("ex1"); |
+ var r = anchorNode.getBoundingClientRect(); |
+ x = (r.left + r.right) / 2 |
+ y = (r.top + r.bottom) / 2; |
+ anchorNode.focus(); |
+ eventSender.keyDown("menu"); |
+} |
+</script> |
+<frameset rows="30%,40%" onload="runTest()"> |
+<frame src="resources/window-opened.html"> |
+<frame id="myframe" src="resources/menu-key-context-menu-position-frame.html"> |
+</frameset> |
+</body> |