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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <title>
4 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.
5 </title>
6 </head>
7 <body onload="test()">
8 <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.
9 <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.
10 <div id="result"></div>
11 <script>
12 var mouseContextMenuTarget = null, keyboardContextMenuTarget = null;
13 function handleContextMenu(e) {
14 if(!mouseContextMenuTarget) {
15 mouseContextMenuTarget = e.target;
16 return false;
17 }
18 if(!keyboardContextMenuTarget) {
19 keyboardContextMenuTarget = e.target;
20 if (mouseContextMenuTarget === keyboardContextMenuTarget) {
21 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.
22 return false;
23 }
24 }
25 document.getElementById("result").innerHTML += "FAIL";
26 }
27
28 function test() {
29 if (window.testRunner)
30 testRunner.dumpAsText();
31
32 if (!window.eventSender)
33 return;
34
35 var anchor = document.getElementById("anchor");
36
37 var r = anchor.getBoundingClientRect();
38 var x = (r.left + r.right) / 2
39 var y = (r.top + r.bottom) / 2;
40 eventSender.mouseMoveTo(x, y);
41 eventSender.contextClick();
42 // Esc key to hide context menu
43 eventSender.keyDown(String.fromCharCode(0x001B));
44 anchor.focus();
45 eventSender.keyDown("menu");
46
47 }
48 </script>
49 </body>
50 </html>
OLDNEW
« 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