Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration_tests/wasm/dart_test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platforms: [chrome, firefox]
platforms: [chrome, firefox, safari]
# Node doesn't work because the version available in the current Ubuntu GitHub runners is too
# old to support WASM+GC, which would be required to run Dart tests.
#platforms: [chrome, firefox, node]
Expand Down
1 change: 1 addition & 0 deletions pkgs/test/lib/dart.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var sendLoadException = function(message) {
window.parent.postMessage({
"data": [0, {"type": "loadException", "message": message}],
"exception": true,
"href": window.location.href,
}, window.location.origin);
}

Expand Down
6 changes: 4 additions & 2 deletions pkgs/test/lib/src/runner/browser/post_message_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ StreamChannel<Object?> postMessageChannel() {
dom.window.console.log('Suite starting, sending channel to host'.toJS);
var controller = StreamChannelController<Object?>(sync: true);
var channel = dom.createMessageChannel();
dom.window.parent
.postMessage('port', dom.window.location.origin, [channel.port2]);
dom.window.parent.postMessage(
{'messageType': 'port', 'href': dom.window.location.href},
dom.window.location.origin,
[channel.port2]);
Comment on lines +19 to +22
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not backwards compatible. A compatible host.dart needs to be rolled out everywhere before we can land this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose maybe I could post two messages, one that is just the 'port' string and the other that's the new structured message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that won't work because we're transferring the port.

var portSubscription =
dom.Subscription(channel.port1, 'message', (dom.Event event) {
controller.local.sink.add((event as dom.MessageEvent).data);
Expand Down
Loading
Loading