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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-event-properties.html

Issue 1968653005: Set width=height=1 of mouse like pointer events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 7 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 | « no previous file | third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-event-properties-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
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <script src="../../../resources/js-test.js"></script> 2 <script src="../../../resources/js-test.js"></script>
3 <script src="../resources/input-modifiers.js"></script> 3 <script src="../resources/input-modifiers.js"></script>
4 <style> 4 <style>
5 div.box { 5 div.box {
6 margin: 10px; 6 margin: 10px;
7 padding: 50px; 7 padding: 50px;
8 float: left; 8 float: left;
9 } 9 }
10 </style> 10 </style>
(...skipping 23 matching lines...) Expand all
34 "offsetY", 34 "offsetY",
35 "pageX", 35 "pageX",
36 "pageY", 36 "pageY",
37 "screenX", 37 "screenX",
38 "screenY", 38 "screenY",
39 "x", 39 "x",
40 "y", 40 "y",
41 "button", 41 "button",
42 "buttons", 42 "buttons",
43 "pressure", 43 "pressure",
44 "width",
45 "height",
44 ]; 46 ];
45 47
46 function init() { 48 function init() {
47 var targetDiv = document.getElementById("target"); 49 var targetDiv = document.getElementById("target");
48 50
49 testEventList.forEach(function(eventName) { 51 testEventList.forEach(function(eventName) {
50 52
51 targetDiv.addEventListener(eventName, function(event) { 53 targetDiv.addEventListener(eventName, function(event) {
52 54
53 debug("Received " + event.type); 55 debug("Received " + event.type);
(...skipping 19 matching lines...) Expand all
73 } 75 }
74 76
75 shouldBeEqualToNumber("lastPointerEvents[0].pointerId", 1); 77 shouldBeEqualToNumber("lastPointerEvents[0].pointerId", 1);
76 shouldBeEqualToString("lastPointerEvents[0].pointerType", "mouse"); 78 shouldBeEqualToString("lastPointerEvents[0].pointerType", "mouse");
77 shouldBeTrue("lastPointerEvents[0].isPrimary"); 79 shouldBeTrue("lastPointerEvents[0].isPrimary");
78 80
79 numericAttributes.forEach(function(attribute) { 81 numericAttributes.forEach(function(attribute) {
80 var expectedValue = eval("event." + attribute); 82 var expectedValue = eval("event." + attribute);
81 if (attribute == "button" && event.type != "mousedown" && event.type != "mouseup") 83 if (attribute == "button" && event.type != "mousedown" && event.type != "mouseup")
82 expectedValue = -1; 84 expectedValue = -1;
85 if (attribute == "width" || attribute == "height")
86 expectedValue = 1;
83 if (attribute == "pressure") { 87 if (attribute == "pressure") {
84 if (event.buttons == 0) 88 if (event.buttons == 0)
85 expectedValue = 0.0; 89 expectedValue = 0.0;
86 else 90 else
87 expectedValue = 0.5; 91 expectedValue = 0.5;
88 } 92 }
89 shouldBeEqualToNumber("lastPointerEvents[0]." + attribute, expectedV alue); 93 shouldBeEqualToNumber("lastPointerEvents[0]." + attribute, expectedV alue);
90 }); 94 });
91 95
92 } else { 96 } else {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 eventSender.mouseMoveTo(rect.left - 5, rect.top - 5); 145 eventSender.mouseMoveTo(rect.left - 5, rect.top - 5);
142 } 146 }
143 147
144 init(); 148 init();
145 if (window.eventSender) 149 if (window.eventSender)
146 runTests(); 150 runTests();
147 else 151 else
148 debug("This test requires eventSender"); 152 debug("This test requires eventSender");
149 153
150 </script> 154 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-event-properties-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698