Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: LayoutTests/fast/events/menu-key-context-menu-position.html

Issue 766143002: Fix contextmenu event location for menu key in an iframe (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adding failure case for mac, as mac does not have menu key. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/events/menu-key-context-menu-position-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/events/menu-key-context-menu-position-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698