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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-two-finger-tap.html

Issue 2446333002: Set right button for mousedown/contextmenu of long press gesture (Closed)
Patch Set: Created 4 years, 1 month 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
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../../resources/js-test.js"></script> 4 <script src="../../../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body onload="test()"> 6 <body onload="test()">
7 <p>This test checks that the context menu is shown on a two finger tap gesture.< /p> 7 <p>This test checks that the context menu is shown on a two finger tap gesture.< /p>
8 <div id="text">Testing</div> 8 <div id="text">Testing</div>
9 <div id="result">FAIL</div> 9 <div id="result">FAIL</div>
10 <div id="eventSequence">Event sequence:</div> 10 <div id="eventSequence">Event sequence:</div>
11 <script> 11 <script>
12 "use strict"; 12 "use strict";
13 13
14 function test() 14 function test()
15 { 15 {
16 if (window.testRunner) 16 if (window.testRunner)
17 testRunner.dumpAsText(); 17 testRunner.dumpAsText();
18 18
19 document.oncontextmenu = function() { 19 document.oncontextmenu = function() {
20 document.getElementById("result").innerHTML = "PASS (ContextMenu event s een)"; 20 document.getElementById("result").innerHTML = "PASS (ContextMenu event s een)";
21 } 21 }
22 22
23 for (let evtType of ["contextmenu", "mouseover", "mousemove", "mouseout", 23 for (let evtType of ["contextmenu", "mouseover", "mousemove", "mouseout",
24 "mouseenter", "mouseleave", "mouseup", "mousedown"]) { 24 "mouseenter", "mouseleave", "mouseup", "mousedown", "click", "auxcli ck"]) {
25 document.addEventListener(evtType, function(e) { 25 document.addEventListener(evtType, function(e) {
26 document.getElementById("eventSequence").innerHTML += " " + e.type; 26 document.getElementById("eventSequence").innerHTML += " " + e.type;
27 }); 27 });
28 } 28 }
29 29
30 var text = document.getElementById("text"); 30 var text = document.getElementById("text");
31 31
32 var x = text.offsetParent.offsetLeft + text.offsetLeft + 4; 32 var x = text.offsetParent.offsetLeft + text.offsetLeft + 4;
33 var y = text.offsetParent.offsetTop + text.offsetTop + text.offsetHeight / 2 ; 33 var y = text.offsetParent.offsetTop + text.offsetTop + text.offsetHeight / 2 ;
34 34
35 if (!window.eventSender) 35 if (!window.eventSender)
36 return; 36 return;
37 if (eventSender.gestureTwoFingerTap) { 37 if (eventSender.gestureTwoFingerTap) {
38 eventSender.gestureTwoFingerTap(x, y); 38 eventSender.gestureTwoFingerTap(x, y);
39 } else { 39 } else {
40 debug("gestureTwoFingerTap not implemented by this platform"); 40 debug("gestureTwoFingerTap not implemented by this platform");
41 return; 41 return;
42 } 42 }
43 } 43 }
44 </script> 44 </script>
45 </body> 45 </body>
46 </html> 46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698