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

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: changing test case. 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/NeverFixTests ('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..8dafac3e00e847bc41f7b3369fc65f3af8e73c16
--- /dev/null
+++ b/LayoutTests/fast/events/menu-key-context-menu-position.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<script src="../../resources/js-test.js"></script>
+<script src="../dom/resources/event-sender-util.js"></script>
+<script>
+ var inputNode;
+ var X,Y, clientX, clientY;
+ 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(event) {
+ shouldBe(event.target.id, 'inputNode');
Rick Byers 2015/01/07 16:57:34 this should be a string as well. Remember the arg
Deepak 2015/01/08 10:11:28 Done.
Deepak 2015/01/08 10:11:29 Done.
+ clientX = event.clientX;
+ clientY = event.clientY;
+ shouldBe("clientX","X");
+ shouldBe("clientY","Y");
+ }
+ function runTest() {
+ if (window.testRunner)
+ testRunner.dumpAsText();
+ if (!window.eventSender)
+ return;
+ inputNode = frames[1].document.getElementById("inputNode");
+ var r = inputNode.getBoundingClientRect();
+ X = (r.left + r.right) / 2
+ Y = (r.top + r.bottom) / 2;
+ inputNode.focus();
+ eventSender.keyDown("menu");
+ }
+</script>
+<body>
Rick Byers 2015/01/07 16:57:34 nit: no need for a body tag: http://www.chromium.o
Deepak 2015/01/08 10:11:29 Done.
+ <iframe src="resources/window-opened.html"></iframe>
Rick Byers 2015/01/07 16:57:34 what is this other iframe for? You can probably r
Deepak 2015/01/08 10:11:28 Done.
+ <iframe id="myframe" style="margin-top:50px" onload="runTest()" src="resources/menu-key-context-menu-position-frame.html"><iframe>
+</body>
« no previous file with comments | « LayoutTests/NeverFixTests ('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