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

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

Issue 85263002: Improve handling of dictionary conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have conversion methods take a context argument; elaborate error msgs further. Created 7 years, 1 month 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 6d29f028bcd25951c1f4a36c90b0bb02b146e7ac..297f2f4027e084043ab4a09e72f01e9f2f4a4de3 100644
--- a/LayoutTests/fast/events/constructors/wheel-event-constructor.html
+++ b/LayoutTests/fast/events/constructors/wheel-event-constructor.html
@@ -45,20 +45,21 @@ shouldBe("new WheelEvent('eventType', { view: window }).view", "window");
shouldBe("new WheelEvent('eventType', { view: this }).view", "this");
// Non-window objects.
-shouldBe("new WheelEvent('eventType', { view: testObject }).view", "null");
-shouldBe("new WheelEvent('eventType', { view: document }).view", "null");
+shouldThrow("new WheelEvent('eventType', { view: testObject }).view");
+shouldThrow("new WheelEvent('eventType', { view: document }).view");
shouldBe("new WheelEvent('eventType', { view: undefined }).view", "null");
shouldBe("new WheelEvent('eventType', { view: null }).view", "null");
-shouldBe("new WheelEvent('eventType', { view: false }).view", "null");
-shouldBe("new WheelEvent('eventType', { view: true }).view", "null");
-shouldBe("new WheelEvent('eventType', { view: '' }).view", "null");
-shouldBe("new WheelEvent('eventType', { view: 'chocolate' }).view", "null");
-shouldBe("new WheelEvent('eventType', { view: 12345 }).view", "null");
-shouldBe("new WheelEvent('eventType', { view: 18446744073709551615 }).view", "null");
-shouldBe("new WheelEvent('eventType', { view: NaN }).view", "null");
+shouldThrow("new WheelEvent('eventType', { view: false }).view");
+shouldThrow("new WheelEvent('eventType', { view: true }).view");
+shouldThrow("new WheelEvent('eventType', { view: '' }).view");
+shouldThrow("new WheelEvent('eventType', { view: 'chocolate' }).view");
+shouldThrow("new WheelEvent('eventType', { view: 12345 }).view");
+shouldThrow("new WheelEvent('eventType', { view: 18446744073709551615 }).view");
+shouldThrow("new WheelEvent('eventType', { view: NaN }).view");
// Note that valueOf() is not called, when the left hand side is evaluated.
-shouldBeFalse("new WheelEvent('eventType', { view: {valueOf: function () { return window; } } }).view == window");
-shouldBe("new WheelEvent('eventType', { get view() { return 123; } }).view", "null");
+shouldThrow("new WheelEvent('eventType', { view: {valueOf: function () { return window; } } }).view == window");
+shouldBe("new WheelEvent('eventType', { get view() { return window; } }).view", "window");
+shouldThrow("new WheelEvent('eventType', { get view() { return 123; } }).view");
shouldThrow("new WheelEvent('eventType', { get view() { throw 'WheelEvent Error'; } })");
// Max/min for client positions (LayoutUnit max/min).
@@ -176,19 +177,20 @@ shouldBe("new WheelEvent('eventType', { relatedTarget: document }).relatedTarget
shouldBe("new WheelEvent('eventType', { relatedTarget: xhr }).relatedTarget", "xhr");
// Invalid objects.
-shouldBe("new WheelEvent('eventType', { relatedTarget: testObject }).relatedTarget", "null");
+shouldThrow("new WheelEvent('eventType', { relatedTarget: testObject }).relatedTarget");
shouldBe("new WheelEvent('eventType', { relatedTarget: undefined }).relatedTarget", "null");
shouldBe("new WheelEvent('eventType', { relatedTarget: null }).relatedTarget", "null");
-shouldBe("new WheelEvent('eventType', { relatedTarget: false }).relatedTarget", "null");
-shouldBe("new WheelEvent('eventType', { relatedTarget: true }).relatedTarget", "null");
-shouldBe("new WheelEvent('eventType', { relatedTarget: '' }).relatedTarget", "null");
-shouldBe("new WheelEvent('eventType', { relatedTarget: 'chocolate' }).relatedTarget", "null");
-shouldBe("new WheelEvent('eventType', { relatedTarget: 12345 }).relatedTarget", "null");
-shouldBe("new WheelEvent('eventType', { relatedTarget: 18446744073709551615 }).relatedTarget", "null");
-shouldBe("new WheelEvent('eventType', { relatedTarget: NaN }).relatedTarget", "null");
+shouldThrow("new WheelEvent('eventType', { relatedTarget: false }).relatedTarget");
+shouldThrow("new WheelEvent('eventType', { relatedTarget: true }).relatedTarget");
+shouldThrow("new WheelEvent('eventType', { relatedTarget: '' }).relatedTarget");
+shouldThrow("new WheelEvent('eventType', { relatedTarget: 'chocolate' }).relatedTarget");
+shouldThrow("new WheelEvent('eventType', { relatedTarget: 12345 }).relatedTarget");
+shouldThrow("new WheelEvent('eventType', { relatedTarget: 18446744073709551615 }).relatedTarget");
+shouldThrow("new WheelEvent('eventType', { relatedTarget: NaN }).relatedTarget");
// Note that valueOf() is not called, when the left hand side is evaluated.
-shouldBeFalse("new WheelEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }).relatedTarget == testDiv");
-shouldBe("new WheelEvent('eventType', { get relatedTarget() { return 123; } }).relatedTarget", "null");
+shouldThrow("new WheelEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }).relatedTarget == testDiv");
+shouldBe("new WheelEvent('eventType', { get relatedTarget() { return testDiv; } }).relatedTarget", "testDiv");
+shouldThrow("new WheelEvent('eventType', { get relatedTarget() { return 123; } }).relatedTarget");
shouldThrow("new WheelEvent('eventType', { get relatedTarget() { throw 'WheelEvent Error'; } })");
// All initializers are passed.

Powered by Google App Engine
This is Rietveld 408576698