| Index: tests/html/postmessage_structured_test.dart
|
| diff --git a/tests/html/postmessage_structured_test.dart b/tests/html/postmessage_structured_test.dart
|
| index 1dc65d7549d6e29dac2caef33d5f93866e9a564a..32daa2a0a34fb7c3f5e3e563b4a3b50ec710d0ea 100644
|
| --- a/tests/html/postmessage_structured_test.dart
|
| +++ b/tests/html/postmessage_structured_test.dart
|
| @@ -78,6 +78,33 @@ main() {
|
| injectSource(JS_CODE);
|
| });
|
|
|
| + test('js-to-dart--null-prototype-eventdata', () {
|
| + // Pass an object with a null prototype from JavaScript.
|
| + // It should be seen as a Dart Map.
|
| + final JS_CODE = """
|
| + // Call anonymous function to create a local scope.
|
| + (function() {
|
| + var o = Object.create(null);
|
| + o.eggs = 3;
|
| + var foo = new MessageEvent('stuff', {data: o});
|
| + window.dispatchEvent(foo);
|
| + })();
|
| + """;
|
| + var completed = false;
|
| + var subscription = null;
|
| + subscription = window.on['stuff'].listen(expectAsyncUntil(
|
| + (MessageEvent e) {
|
| + var data = e.data;
|
| + if (data is String) return; // Messages from unit test protocol.
|
| + completed = true;
|
| + subscription.cancel();
|
| + expect(data, isMap);
|
| + expect(data['eggs'], equals(3));
|
| + },
|
| + () => completed));
|
| + injectSource(JS_CODE);
|
| + });
|
| +
|
| test('dart-to-js-to-dart-postmessage', () {
|
| // Pass dictionaries between Dart and JavaScript.
|
|
|
|
|