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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-long-press.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 <style> 5 <style>
6 #empty { 6 #empty {
7 width: 100px; 7 width: 100px;
8 height: 50px; 8 height: 50px;
9 } 9 }
10 </style> 10 </style>
(...skipping 22 matching lines...) Expand all
33 33
34 function test() 34 function test()
35 { 35 {
36 if (window.testRunner) 36 if (window.testRunner)
37 testRunner.dumpAsText(); 37 testRunner.dumpAsText();
38 38
39 document.oncontextmenu = function() { 39 document.oncontextmenu = function() {
40 testResult = "PASS: Context Menu event seen."; 40 testResult = "PASS: Context Menu event seen.";
41 } 41 }
42 for (let evtType of ["contextmenu", "mouseover", "mousemove", "mouseout", 42 for (let evtType of ["contextmenu", "mouseover", "mousemove", "mouseout",
43 "mouseenter", "mouseleave", "mouseup", "mousedown"]) { 43 "mouseenter", "mouseleave", "mouseup", "mousedown", "click", "auxcli ck"]) {
44 document.addEventListener(evtType, function(e) { 44 document.addEventListener(evtType, function(e) {
45 eventSequence += " " + e.type; 45 eventSequence += " " + e.type;
46 }); 46 });
47 } 47 }
48 48
49 var empty = document.getElementById("empty"); 49 var empty = document.getElementById("empty");
50 50
51 var x = empty.offsetParent.offsetLeft + empty.offsetLeft + 4; 51 var x = empty.offsetParent.offsetLeft + empty.offsetLeft + 4;
52 var y = empty.offsetParent.offsetTop + empty.offsetTop + empty.offsetHeight / 2; 52 var y = empty.offsetParent.offsetTop + empty.offsetTop + empty.offsetHeight / 2;
53 53
54 if (!window.eventSender) 54 if (!window.eventSender)
55 return; 55 return;
56 56
57 if (!eventSender.gestureLongPress) { 57 if (!eventSender.gestureLongPress) {
58 debug("gestureLongPress not implemented by this platform"); 58 debug("gestureLongPress not implemented by this platform");
59 return; 59 return;
60 } 60 }
61 61
62 debug(""); 62 debug("");
63 runTest(x, y, true); 63 runTest(x, y, true);
64 runTest(x, y, false); 64 runTest(x, y, false);
65 } 65 }
66 </script> 66 </script>
67 </body> 67 </body>
68 </html> 68 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698