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

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

Issue 23319002: Set MessageEvent.source to the newly created port for shared workers' connect events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add test and assertions Created 7 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/fast/events/constructors/message-event-constructor-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 20155cdbc4c9faa9bed80573ebbb6e21e2a0be53..4e6e5ee4dcd1f3376a98c270029ad72080334c44 100644
--- a/LayoutTests/fast/events/constructors/message-event-constructor.html
+++ b/LayoutTests/fast/events/constructors/message-event-constructor.html
@@ -71,9 +71,14 @@ shouldThrow("new MessageEvent('eventType', { get data() { throw 'MessageEvent Er
shouldBe("new MessageEvent('eventType', { source: window }).source", "window");
shouldBe("new MessageEvent('eventType', { source: this }).source", "this");
+// MessagePort objects.
+var channel = new MessageChannel();
+shouldBe("new MessageEvent('eventType', { ports: [channel.port1], source: channel.port1 }).source", "null");
do-not-use 2013/08/19 20:47:55 I added this check as well since I assume this is
+
// Non-window objects.
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");
do-not-use 2013/08/19 20:47:55 Added a Node check as suggested.
shouldBe("new MessageEvent('eventType', { source: undefined }).source", "null");
shouldBe("new MessageEvent('eventType', { source: null }).source", "null");
shouldBe("new MessageEvent('eventType', { source: false }).source", "null");
@@ -90,7 +95,6 @@ shouldThrow("new MessageEvent('eventType', { get source() { throw 'MessageEvent
// ports is passed.
// Valid message ports.
-var channel = new MessageChannel();
var channel2 = new MessageChannel();
shouldBe("new MessageEvent('eventType', { ports: [channel.port1, channel.port2, channel2.port1] }).ports[0]", "channel.port1");
shouldBe("new MessageEvent('eventType', { ports: [channel.port1, channel.port2, channel2.port1] }).ports[1]", "channel.port2");
« no previous file with comments | « no previous file | LayoutTests/fast/events/constructors/message-event-constructor-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698