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

Unified Diff: LayoutTests/fast/events/constructors/message-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/message-event-constructor.html
diff --git a/LayoutTests/fast/events/constructors/message-event-constructor.html b/LayoutTests/fast/events/constructors/message-event-constructor.html
index 2c10fad5bb452305401b7167ea6774340993b574..93009a671d0b52763baa6b2e0bd296d339c97285 100644
--- a/LayoutTests/fast/events/constructors/message-event-constructor.html
+++ b/LayoutTests/fast/events/constructors/message-event-constructor.html
@@ -76,21 +76,22 @@ var channel = new MessageChannel();
shouldBe("new MessageEvent('eventType', { ports: [channel.port1], source: channel.port1 }).source", "channel.port1");
// Unacceptable source objects (not a Window or a MessagePort).
-shouldBe("new MessageEvent('eventType', { source: test_object }).source", "null");
-shouldBe("new MessageEvent('eventType', { source: document }).source", "null");
-shouldBe("new MessageEvent('eventType', { source: document.body }).source", "null");
+shouldThrow("new MessageEvent('eventType', { source: test_object }).source");
+shouldThrow("new MessageEvent('eventType', { source: document }).source");
+shouldThrow("new MessageEvent('eventType', { source: document.body }).source");
shouldBe("new MessageEvent('eventType', { source: undefined }).source", "null");
shouldBe("new MessageEvent('eventType', { source: null }).source", "null");
-shouldBe("new MessageEvent('eventType', { source: false }).source", "null");
-shouldBe("new MessageEvent('eventType', { source: true }).source", "null");
-shouldBe("new MessageEvent('eventType', { source: '' }).source", "null");
-shouldBe("new MessageEvent('eventType', { source: 'chocolate' }).source", "null");
-shouldBe("new MessageEvent('eventType', { source: 12345 }).source", "null");
-shouldBe("new MessageEvent('eventType', { source: 18446744073709551615 }).source", "null");
-shouldBe("new MessageEvent('eventType', { source: NaN }).source", "null");
+shouldThrow("new MessageEvent('eventType', { source: false }).source");
+shouldThrow("new MessageEvent('eventType', { source: true }).source");
+shouldThrow("new MessageEvent('eventType', { source: '' }).source");
+shouldThrow("new MessageEvent('eventType', { source: 'chocolate' }).source");
+shouldThrow("new MessageEvent('eventType', { source: 12345 }).source");
+shouldThrow("new MessageEvent('eventType', { source: 18446744073709551615 }).source");
+shouldThrow("new MessageEvent('eventType', { source: NaN }).source");
// Note that valueOf() is not called, when the left hand side is evaluated.
-shouldBeFalse("new MessageEvent('eventType', { source: {valueOf: function () { return window; } } }).source == window");
-shouldBe("new MessageEvent('eventType', { get source() { return 123; } }).source", "null");
+shouldThrow("new MessageEvent('eventType', { source: {valueOf: function () { return window; } } }).source == window");
+shouldBe("new MessageEvent('eventType', { get source() { return window; } }).source", "window");
+shouldThrow("new MessageEvent('eventType', { get source() { return 123; } }).source");
shouldThrow("new MessageEvent('eventType', { get source() { throw 'MessageEvent Error'; } })");
// ports is passed.

Powered by Google App Engine
This is Rietveld 408576698