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

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

Issue 964783003: Add [TypeChecking=Unrestricted] to {Transition,Wheel}EventInit (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix test expectations Created 5 years, 10 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 297f2f4027e084043ab4a09e72f01e9f2f4a4de3..03a92936bfa99ecfa1920c21e6a02ba0c1b1c8ca 100644
--- a/LayoutTests/fast/events/constructors/wheel-event-constructor.html
+++ b/LayoutTests/fast/events/constructors/wheel-event-constructor.html
@@ -66,7 +66,7 @@ shouldThrow("new WheelEvent('eventType', { get view() { throw 'WheelEvent Error'
var MAX_CLIENT_SIZE = "33554431";
var MIN_CLIENT_SIZE = "-33554432";
-// detail, screenX, screenY, clientX and clientY are passed.
+// detail, screenX, screenY, clientX, clientY, wheelDeltaX and wheelDeltaY are passed.
["detail", "screenX", "screenY", "clientX", "clientY", "wheelDeltaX", "wheelDeltaY"].forEach(function (attr) {
// numbers within the long range.
shouldBe("new WheelEvent('eventType', { " + attr + ": 0 })." + attr, "0");
@@ -98,6 +98,37 @@ var MIN_CLIENT_SIZE = "-33554432";
shouldBe("new WheelEvent('eventType', { " + attr + ": {valueOf: function () { return 12345; }} })." + attr, "12345");
});
+["deltaX", "deltaY", "deltaZ"].forEach(function (attr) {
+ // numbers within the long range.
+ shouldBe("new WheelEvent('eventType', { " + attr + ": 0 })." + attr, "0");
+ shouldBe("new WheelEvent('eventType', { " + attr + ": 2147483647 })." + attr, "2147483647");
+ shouldBe("new WheelEvent('eventType', { " + attr + ": -1 })." + attr, "-1");
+ shouldBe("new WheelEvent('eventType', { " + attr + ": -2147483648 })." + attr, "-2147483648");
+
+ // numbers out of the long range.
+ shouldBe("new WheelEvent('eventType', { " + attr + ": 4294967295 })." + attr, "4294967295");
+ // 2^{53}-1, the largest number that can be exactly represented by double.
+ shouldBe("new WheelEvent('eventType', { " + attr + ": 9007199254740991 })." + attr, "9007199254740991");
+ // 2^{64}-1
+ shouldBe("new WheelEvent('eventType', { " + attr + ": 18446744073709551615 })." + attr, "18446744073709551615");
+ shouldBe("new WheelEvent('eventType', { " + attr + ": 123.45 })." + attr, "123.45");
+ shouldThrow("new WheelEvent('eventType', { " + attr + ": NaN })." + attr);
+
+ // Non-numeric values.
+ shouldBe("new WheelEvent('eventType', { " + attr + ": undefined })." + attr, "0");
+ shouldBe("new WheelEvent('eventType', { " + attr + ": null })." + attr, "0");
+ shouldBe("new WheelEvent('eventType', { " + attr + ": '' })." + attr, "0");
+ shouldBe("new WheelEvent('eventType', { " + attr + ": '12345' })." + attr, "12345");
+ shouldThrow("new WheelEvent('eventType', { " + attr + ": '12345a' })." + attr);
+ shouldThrow("new WheelEvent('eventType', { " + attr + ": 'abc' })." + attr);
+ shouldBe("new WheelEvent('eventType', { " + attr + ": [] })." + attr, "0");
+ shouldBe("new WheelEvent('eventType', { " + attr + ": [12345] })." + attr, "12345");
+ shouldThrow("new WheelEvent('eventType', { " + attr + ": [12345, 67890] })." + attr);
+ shouldThrow("new WheelEvent('eventType', { " + attr + ": {} })." + attr);
+ shouldThrow("new WheelEvent('eventType', { " + attr + ": {moemoe: 12345} })." + attr);
+ shouldBe("new WheelEvent('eventType', { " + attr + ": {valueOf: function () { return 12345; }} })." + attr, "12345");
+});
+
// deltaMode is passed.
// numbers within the unsigned long range.
shouldBe("new WheelEvent('eventType', { deltaMode: 0 }).deltaMode", "0");

Powered by Google App Engine
This is Rietveld 408576698