Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit c325e82

Browse files
committed
add tests for other types
1 parent 94c7373 commit c325e82

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

lib/web_ui/test/engine/platform_views/message_handler_test.dart

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,18 @@ void testMain() {
136136
completers.last.complete,
137137
);
138138

139+
completers.add(Completer<ByteData?>());
140+
messageHandler.handlePlatformViewCall(
141+
_getCreateMessage(viewType, 333, 'foobar'),
142+
completers.last.complete,
143+
);
144+
145+
completers.add(Completer<ByteData?>());
146+
messageHandler.handlePlatformViewCall(
147+
_getCreateMessage(viewType, 444, <dynamic>[1, null, 'str']),
148+
completers.last.complete,
149+
);
150+
139151
final List<ByteData?> responses = await Future.wait(
140152
completers.map((Completer<ByteData?> c) => c.future),
141153
);
@@ -148,11 +160,15 @@ void testMain() {
148160
);
149161
}
150162

151-
expect(factoryCalls, hasLength(2));
163+
expect(factoryCalls, hasLength(4));
152164
expect(factoryCalls[0].viewId, 111);
153165
expect(factoryCalls[0].params, isNull);
154166
expect(factoryCalls[1].viewId, 222);
155167
expect(factoryCalls[1].params, <dynamic, dynamic>{'foo': 'bar'});
168+
expect(factoryCalls[2].viewId, 333);
169+
expect(factoryCalls[2].params, 'foobar');
170+
expect(factoryCalls[3].viewId, 444);
171+
expect(factoryCalls[3].params, <dynamic>[1, null, 'str']);
156172
});
157173

158174
test('fails if the factory returns a non-DOM object', () async {

0 commit comments

Comments
 (0)