| Index: third_party/WebKit/LayoutTests/fast/events/constructors/wheel-event-constructor.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/wheel-event-constructor.html b/third_party/WebKit/LayoutTests/fast/events/constructors/wheel-event-constructor.html
|
| index 977df4cba0fae19e7d165bc6fa2ee8e8552584fa..fbe54456a24ba46bc5c8ef88d774b9581fa46e45 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/events/constructors/wheel-event-constructor.html
|
| +++ b/third_party/WebKit/LayoutTests/fast/events/constructors/wheel-event-constructor.html
|
| @@ -62,12 +62,72 @@ shouldBe("new WheelEvent('eventType', { get view() { return window; } }).view",
|
| shouldThrow("new WheelEvent('eventType', { get view() { return 123; } }).view");
|
| shouldThrow("new WheelEvent('eventType', { get view() { throw 'WheelEvent Error'; } })");
|
|
|
| +// detail is passed.
|
| +// numbers within the long range.
|
| +shouldBe("new WheelEvent('eventType', { detail: 0 }).detail", "0");
|
| +shouldBe("new WheelEvent('eventType', { detail: 2147483647 }).detail", "2147483647");
|
| +shouldBe("new WheelEvent('eventType', { detail: -1 }).detail", "-1");
|
| +shouldBe("new WheelEvent('eventType', { detail: -2147483648 }).detail", "-2147483648");
|
| +// numbers out of the long range.
|
| +shouldBe("new WheelEvent('eventType', { detail: 4294967295 }).detail", "-1");
|
| +// 2^{53}-1, the largest number that can be exactly represented by double.
|
| +shouldBe("new WheelEvent('eventType', { detail: 9007199254740991 }).detail", "-1");
|
| +// 2^{64}-1
|
| +shouldBe("new WheelEvent('eventType', { detail: 18446744073709551615 }).detail", "0");
|
| +shouldBe("new WheelEvent('eventType', { detail: 123.45 }).detail", "123");
|
| +shouldBe("new WheelEvent('eventType', { detail: NaN }).detail", "0");
|
| +// Non-numeric values.
|
| +shouldBe("new WheelEvent('eventType', { detail: undefined }).detail", "0");
|
| +shouldBe("new WheelEvent('eventType', { detail: null }).detail", "0");
|
| +shouldBe("new WheelEvent('eventType', { detail: '' }).detail", "0");
|
| +shouldBe("new WheelEvent('eventType', { detail: '12345' }).detail", "12345");
|
| +shouldBe("new WheelEvent('eventType', { detail: '12345a' }).detail", "0");
|
| +shouldBe("new WheelEvent('eventType', { detail: 'abc' }).detail", "0");
|
| +shouldBe("new WheelEvent('eventType', { detail: [] }).detail", "0");
|
| +shouldBe("new WheelEvent('eventType', { detail: [12345] }).detail", "12345");
|
| +shouldBe("new WheelEvent('eventType', { detail: [12345, 67890] }).detail", "0");
|
| +shouldBe("new WheelEvent('eventType', { detail: {} }).detail", "0");
|
| +shouldBe("new WheelEvent('eventType', { detail: {moemoe: 12345} }).detail", "0");
|
| +shouldBe("new WheelEvent('eventType', { detail: {valueOf: function () { return 12345; }} }).detail", "12345");
|
| +
|
| // Max/min for client positions (LayoutUnit max/min).
|
| var MAX_CLIENT_SIZE = "33554431";
|
| var MIN_CLIENT_SIZE = "-33554432";
|
|
|
| -// detail, screenX, screenY, clientX, clientY, wheelDeltaX and wheelDeltaY are passed.
|
| -["detail", "screenX", "screenY", "clientX", "clientY", "wheelDeltaX", "wheelDeltaY"].forEach(function (attr) {
|
| +// screenX, screenY, clientX and clientY are passed.
|
| +["screenX", "screenY", "clientX", "clientY"].forEach(function (attr) {
|
| + // numbers within the long range.
|
| + shouldBe("new WheelEvent('eventType', { " + attr + ": 0 })." + attr, "0");
|
| + shouldBe("new WheelEvent('eventType', { " + attr + ": 2147483647 })." + attr, MAX_CLIENT_SIZE);
|
| + shouldBe("new WheelEvent('eventType', { " + attr + ": -1 })." + attr, "-1");
|
| + shouldBe("new WheelEvent('eventType', { " + attr + ": -2147483648 })." + attr, MIN_CLIENT_SIZE);
|
| +
|
| + // numbers out of the long range.
|
| + shouldBe("new WheelEvent('eventType', { " + attr + ": 4294967295 })." + attr, MAX_CLIENT_SIZE);
|
| + // 2^{53}-1, the largest number that can be exactly represented by double.
|
| + shouldBe("new WheelEvent('eventType', { " + attr + ": 9007199254740991 })." + attr, MAX_CLIENT_SIZE);
|
| + // 2^{64}-1
|
| + shouldBe("new WheelEvent('eventType', { " + attr + ": 18446744073709551615 })." + attr, MAX_CLIENT_SIZE);
|
| + shouldBe("new WheelEvent('eventType', { " + attr + ": 123.45 })." + attr, "123");
|
| + 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");
|
| +});
|
| +
|
| +// wheelDeltaX and wheelDeltaY are passed.
|
| +["wheelDeltaX", "wheelDeltaY"].forEach(function (attr) {
|
| // numbers within the long range.
|
| shouldBe("new WheelEvent('eventType', { " + attr + ": 0 })." + attr, "0");
|
| shouldBe("new WheelEvent('eventType', { " + attr + ": 2147483647 })." + attr, attr == "clientX" || attr == "clientY" ? MAX_CLIENT_SIZE : "2147483647");
|
|
|