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

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: Added layout test (only for Linux and Windows) 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..23956278653577d2bb77200b059235e29d5ba7b4
--- /dev/null
+++ b/LayoutTests/fast/events/menu-key-context-menu.html
@@ -0,0 +1,50 @@
+<html>
+<head>
+<title>
+Test for context menu customized for element type
tkent 2014/04/23 05:25:10 This doesn't test it. It should be something like
anish.p 2014/04/23 05:43:59 Done.
+</title>
+</head>
+<body onload="test()">
+<p>This test checks if customized context menu is displayed for various elements.</p>
tkent 2014/04/23 05:25:10 Ditto.
anish.p 2014/04/23 05:43:59 Done.
+<a href="" id="anchor" oncontextmenu="handleContextMenu(event);">Test</a>
tkent 2014/04/23 05:25:10 The oncontextmenu attribute means the handler is c
anish.p 2014/04/23 05:43:59 Done.
+<div id="result"></div>
+<script>
+var mouseContextMenuTarget = null, keyboardContextMenuTarget = null;
+function handleContextMenu(e) {
+ if(!mouseContextMenuTarget) {
+ mouseContextMenuTarget = e.target;
+ return false;
+ }
+ if(!keyboardContextMenuTarget) {
+ keyboardContextMenuTarget = e.target;
+ if (mouseContextMenuTarget === keyboardContextMenuTarget) {
+ document.getElementById("result").innerHTML += "PASS";
tkent 2014/04/23 05:25:10 - <div id="result"></div> -> <div id="result">FAIL
anish.p 2014/04/23 05:43:59 Done.
+ return false;
+ }
+ }
+ document.getElementById("result").innerHTML += "FAIL";
+}
+
+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