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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/events/constructors/wheel-event-constructor.html
diff --git a/LayoutTests/fast/events/constructors/wheel-event-constructor.html b/LayoutTests/fast/events/constructors/wheel-event-constructor.html
index 03a92936bfa99ecfa1920c21e6a02ba0c1b1c8ca..977df4cba0fae19e7d165bc6fa2ee8e8552584fa 100644
--- a/LayoutTests/fast/events/constructors/wheel-event-constructor.html
+++ b/LayoutTests/fast/events/constructors/wheel-event-constructor.html
@@ -170,22 +170,28 @@ shouldBe("new WheelEvent('eventType', { deltaMode: {valueOf: function () { retur
});
// button is passed.
-// Numbers within the unsigned short range.
+// Numbers within the short range.
shouldBe("new WheelEvent('eventType', { button: 0 }).button", "0");
shouldBe("new WheelEvent('eventType', { button: 1 }).button", "1");
-shouldBe("new WheelEvent('eventType', { button: 65534 }).button", "65534");
+shouldBe("new WheelEvent('eventType', { button: -2 }).button", "-2");
+shouldBe("new WheelEvent('eventType', { button: -32768 }).button", "-32768");
+shouldBe("new WheelEvent('eventType', { button: 32767 }).button", "32767");
-// Numbers that are equal to ((unsigned short)-1) should be treated as 0.
+// Numbers that are equal to -1 should be treated as 0.
shouldBe("new WheelEvent('eventType', { button: 65535 }).button", "0");
shouldBe("new WheelEvent('eventType', { button: 9007199254740991 }).button", "0");
shouldBe("new WheelEvent('eventType', { button: -1 }).button", "0");
-// Numbers out of the unsigned short range.
+// Numbers out of the short range.
// 2^{64}-1
shouldBe("new WheelEvent('eventType', { button: 18446744073709551615 }).button", "0");
shouldBe("new WheelEvent('eventType', { button: 12345678901234567890 }).button", "2048");
shouldBe("new WheelEvent('eventType', { button: 123.45 }).button", "123");
shouldBe("new WheelEvent('eventType', { button: NaN }).button", "0");
+shouldBe("new WheelEvent('eventType', { button: 65534 }).button", "-2");
+shouldBe("new WheelEvent('eventType', { button: -32769 }).button", "32767");
+shouldBe("new WheelEvent('eventType', { button: 32768 }).button", "-32768");
+
// Non-numeric values.
shouldBe("new WheelEvent('eventType', { button: undefined }).button", "0");

Powered by Google App Engine
This is Rietveld 408576698