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

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

Issue 1976603006: Set view property of pointer events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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>
11 11
12 <div id="target" class="box" style="background-color:red"> 12 <div id="target" class="box" style="background-color:red">
13 </div> 13 </div>
14 14
15 <div id="console"></div> 15 <div id="console"></div>
16 16
17 <script> 17 <script>
18 window.name = "mainWindow";
18 description("Verifies that pointer event parameters are correct when fired for m ouse events."); 19 description("Verifies that pointer event parameters are correct when fired for m ouse events.");
19 20
20 var testEventList = ["mouseenter", "mouseleave", "mouseover", "mouseout", "mouse up", "mousedown", "mousemove", 21 var testEventList = ["mouseenter", "mouseleave", "mouseover", "mouseout", "mouse up", "mousedown", "mousemove",
21 "pointerenter", "pointerleave", "pointerover", "pointerout", "pointerup", "pointerdown", "pointermove"]; 22 "pointerenter", "pointerleave", "pointerover", "pointerout", "pointerup", "pointerdown", "pointermove"];
22 var lastPointerEvents = []; 23 var lastPointerEvents = [];
23 24
24 var checkKeyModifiers = false; 25 var checkKeyModifiers = false;
25 26
26 var numericAttributes = [ 27 var numericAttributes = [
27 "clientX", 28 "clientX",
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 if (attribute == "button" && event.type != "mousedown" && event.type != "mouseup") 82 if (attribute == "button" && event.type != "mousedown" && event.type != "mouseup")
82 expectedValue = -1; 83 expectedValue = -1;
83 if (attribute == "pressure") { 84 if (attribute == "pressure") {
84 if (event.buttons == 0) 85 if (event.buttons == 0)
85 expectedValue = 0.0; 86 expectedValue = 0.0;
86 else 87 else
87 expectedValue = 0.5; 88 expectedValue = 0.5;
88 } 89 }
89 shouldBeEqualToNumber("lastPointerEvents[0]." + attribute, expectedV alue); 90 shouldBeEqualToNumber("lastPointerEvents[0]." + attribute, expectedV alue);
90 }); 91 });
92 shouldBeEqualToString("lastPointerEvents[0].view.name", "mainWindow");
91 93
92 } else { 94 } else {
93 95
94 forEachModifier(function(attr, modifierName) { 96 forEachModifier(function(attr, modifierName) {
95 var getModifierStateStr = ".getModifierState('" + modifierName + "') ;" 97 var getModifierStateStr = ".getModifierState('" + modifierName + "') ;"
96 if (eval("event" + getModifierStateStr)) 98 if (eval("event" + getModifierStateStr))
97 shouldBeTrue("lastPointerEvents[0]" + getModifierStateStr); 99 shouldBeTrue("lastPointerEvents[0]" + getModifierStateStr);
98 else 100 else
99 shouldBeFalse("lastPointerEvents[0]" + getModifierStateStr); 101 shouldBeFalse("lastPointerEvents[0]" + getModifierStateStr);
100 }); 102 });
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 eventSender.mouseMoveTo(rect.left - 5, rect.top - 5); 143 eventSender.mouseMoveTo(rect.left - 5, rect.top - 5);
142 } 144 }
143 145
144 init(); 146 init();
145 if (window.eventSender) 147 if (window.eventSender)
146 runTests(); 148 runTests();
147 else 149 else
148 debug("This test requires eventSender"); 150 debug("This test requires eventSender");
149 151
150 </script> 152 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698