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

Side by Side Diff: LayoutTests/fast/events/constructors/wheel-event-constructor.html

Issue 1165693005: Change MouseEvent.button to be 'short' instead of 'unsigned short' (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updating as per review comments Created 5 years, 6 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 <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> 6 <body>
7 <script> 7 <script>
8 8
9 description("This tests the constructor for the WheelEvent DOM class."); 9 description("This tests the constructor for the WheelEvent DOM class.");
10 10
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 shouldBe("new WheelEvent('eventType', { deltaMode: {moemoe: 12345} }).deltaMode" , "0"); 163 shouldBe("new WheelEvent('eventType', { deltaMode: {moemoe: 12345} }).deltaMode" , "0");
164 shouldBe("new WheelEvent('eventType', { deltaMode: {valueOf: function () { retur n 12345; }} }).deltaMode", "12345"); 164 shouldBe("new WheelEvent('eventType', { deltaMode: {valueOf: function () { retur n 12345; }} }).deltaMode", "12345");
165 165
166 // ctrlKey, altKey, shiftKey and metaKey are passed. 166 // ctrlKey, altKey, shiftKey and metaKey are passed.
167 ["ctrlKey", "altKey", "shiftKey", "metaKey"].forEach(function (attr) { 167 ["ctrlKey", "altKey", "shiftKey", "metaKey"].forEach(function (attr) {
168 shouldBe("new WheelEvent('eventType', { " + attr + ": false })." + attr, "fa lse"); 168 shouldBe("new WheelEvent('eventType', { " + attr + ": false })." + attr, "fa lse");
169 shouldBe("new WheelEvent('eventType', { " + attr + ": true })." + attr, "tru e"); 169 shouldBe("new WheelEvent('eventType', { " + attr + ": true })." + attr, "tru e");
170 }); 170 });
171 171
172 // button is passed. 172 // button is passed.
173 // Numbers within the unsigned short range. 173 // Numbers within the short range.
174 shouldBe("new WheelEvent('eventType', { button: 0 }).button", "0"); 174 shouldBe("new WheelEvent('eventType', { button: 0 }).button", "0");
175 shouldBe("new WheelEvent('eventType', { button: 1 }).button", "1"); 175 shouldBe("new WheelEvent('eventType', { button: 1 }).button", "1");
176 shouldBe("new WheelEvent('eventType', { button: 65534 }).button", "65534");
philipj_slow 2015/06/10 08:46:25 Ditto.
ramya.v 2015/06/10 09:21:28 Done.
177 176
178 // Numbers that are equal to ((unsigned short)-1) should be treated as 0. 177 // Numbers that are equal to -1 should be treated as 0.
179 shouldBe("new WheelEvent('eventType', { button: 65535 }).button", "0"); 178 shouldBe("new WheelEvent('eventType', { button: 65535 }).button", "0");
180 shouldBe("new WheelEvent('eventType', { button: 9007199254740991 }).button", "0" ); 179 shouldBe("new WheelEvent('eventType', { button: 9007199254740991 }).button", "0" );
181 shouldBe("new WheelEvent('eventType', { button: -1 }).button", "0"); 180 shouldBe("new WheelEvent('eventType', { button: -1 }).button", "0");
182 181
183 // Numbers out of the unsigned short range. 182 // Numbers out of the short range.
184 // 2^{64}-1 183 // 2^{64}-1
185 shouldBe("new WheelEvent('eventType', { button: 18446744073709551615 }).button", "0"); 184 shouldBe("new WheelEvent('eventType', { button: 18446744073709551615 }).button", "0");
186 shouldBe("new WheelEvent('eventType', { button: 12345678901234567890 }).button", "2048"); 185 shouldBe("new WheelEvent('eventType', { button: 12345678901234567890 }).button", "2048");
187 shouldBe("new WheelEvent('eventType', { button: 123.45 }).button", "123"); 186 shouldBe("new WheelEvent('eventType', { button: 123.45 }).button", "123");
188 shouldBe("new WheelEvent('eventType', { button: NaN }).button", "0"); 187 shouldBe("new WheelEvent('eventType', { button: NaN }).button", "0");
189 188
190 // Non-numeric values. 189 // Non-numeric values.
191 shouldBe("new WheelEvent('eventType', { button: undefined }).button", "0"); 190 shouldBe("new WheelEvent('eventType', { button: undefined }).button", "0");
192 shouldBe("new WheelEvent('eventType', { button: null }).button", "0"); 191 shouldBe("new WheelEvent('eventType', { button: null }).button", "0");
193 shouldBe("new WheelEvent('eventType', { button: '' }).button", "0"); 192 shouldBe("new WheelEvent('eventType', { button: '' }).button", "0");
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 shouldBe("new WheelEvent('eventType', { bubbles: true, cancelable: true, view: w indow, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrl Key: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarg et: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA _PAGE }).altKey", "true"); 237 shouldBe("new WheelEvent('eventType', { bubbles: true, cancelable: true, view: w indow, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrl Key: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarg et: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA _PAGE }).altKey", "true");
239 shouldBe("new WheelEvent('eventType', { bubbles: true, cancelable: true, view: w indow, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrl Key: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarg et: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA _PAGE }).metaKey", "true"); 238 shouldBe("new WheelEvent('eventType', { bubbles: true, cancelable: true, view: w indow, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrl Key: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarg et: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA _PAGE }).metaKey", "true");
240 shouldBe("new WheelEvent('eventType', { bubbles: true, cancelable: true, view: w indow, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrl Key: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarg et: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA _PAGE }).button", "666"); 239 shouldBe("new WheelEvent('eventType', { bubbles: true, cancelable: true, view: w indow, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrl Key: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarg et: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA _PAGE }).button", "666");
241 shouldBe("new WheelEvent('eventType', { bubbles: true, cancelable: true, view: w indow, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrl Key: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarg et: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA _PAGE }).relatedTarget", "testDiv"); 240 shouldBe("new WheelEvent('eventType', { bubbles: true, cancelable: true, view: w indow, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrl Key: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarg et: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA _PAGE }).relatedTarget", "testDiv");
242 shouldBe("new WheelEvent('eventType', { bubbles: true, cancelable: true, view: w indow, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrl Key: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarg et: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA _PAGE }).wheelDeltaX", "777"); 241 shouldBe("new WheelEvent('eventType', { bubbles: true, cancelable: true, view: w indow, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrl Key: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarg et: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA _PAGE }).wheelDeltaX", "777");
243 shouldBe("new WheelEvent('eventType', { bubbles: true, cancelable: true, view: w indow, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrl Key: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarg et: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA _PAGE }).wheelDeltaY", "888"); 242 shouldBe("new WheelEvent('eventType', { bubbles: true, cancelable: true, view: w indow, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrl Key: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarg et: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA _PAGE }).wheelDeltaY", "888");
244 shouldBe("new WheelEvent('eventType', { bubbles: true, cancelable: true, view: w indow, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrl Key: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarg et: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA _PAGE }).deltaMode", "WheelEvent.DOM_DELTA_PAGE"); 243 shouldBe("new WheelEvent('eventType', { bubbles: true, cancelable: true, view: w indow, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrl Key: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarg et: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA _PAGE }).deltaMode", "WheelEvent.DOM_DELTA_PAGE");
245 </script> 244 </script>
246 </body> 245 </body>
247 </html> 246 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698