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

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

Issue 247023002: Correcting menu button event trigger location (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Layout test changes as per review comments Created 6 years, 8 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-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.html
diff --git a/LayoutTests/fast/events/menu-key-context-menu.html b/LayoutTests/fast/events/menu-key-context-menu.html
new file mode 100644
index 0000000000000000000000000000000000000000..83f0a5574d32ab1f797043c772cc743ec210b583
--- /dev/null
+++ b/LayoutTests/fast/events/menu-key-context-menu.html
@@ -0,0 +1,42 @@
+<html>
+<head>
+<title>
+Test for contextmenu event target
+</title>
+</head>
+<body onload="test()">
+<p>This test checks if contextmenu event target is correct when triggered from menu key.</p>
+<a href="" id="anchor" oncontextmenu="handleContextMenu(event);">Test</a>
+<div id="result">FAIL</div>
+<script>
+var count = 0;
+function handleContextMenu(e) {
+ count++;
+ if(count === 2)
+ document.getElementById("result").innerHTML = "PASS";
+ return false;
+}
+
+function test() {
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ if (!window.eventSender)
+ return;
+
+ var anchor = document.getElementById("anchor");
+
+ var r = anchor.getBoundingClientRect();
+ var x = (r.left + r.right) / 2
+ var y = (r.top + r.bottom) / 2;
+ eventSender.mouseMoveTo(x, y);
+ eventSender.contextClick();
+ // Esc key to hide context menu
+ eventSender.keyDown(String.fromCharCode(0x001B));
+ anchor.focus();
+ eventSender.keyDown("menu");
+
+}
+</script>
+</body>
+</html>
« no previous file with comments | « LayoutTests/NeverFixTests ('k') | LayoutTests/fast/events/menu-key-context-menu-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698