Unverified Commit 7db0564a authored by Vyacheslav Egorov's avatar Vyacheslav Egorov Committed by GitHub

Fix message channel usage in few tests. (#14557)

Channels don't preserve Map and List type arguments: Map<String, Object>
arrives as Map<dynamic, dynamic> to the receiver.

In Dart 2 type system dynamic no longer serves as bottom type so
Map<dynamic, dynamic> can't be assign to a variable of type
Map<String, dynamic>.

Issue #14556
parent 9bc048cb
......@@ -10,10 +10,10 @@ import 'package:test/test.dart';
void main() {
test('Semantic announcement', () async {
final List<Map<String, dynamic>> log = <Map<String, dynamic>>[];
final List<Map<dynamic, dynamic>> log = <Map<dynamic, dynamic>>[];
SystemChannels.accessibility.setMockMessageHandler((Object mockMessage) async {
final Map<String, dynamic> message = mockMessage;
final Map<dynamic, dynamic> message = mockMessage;
log.add(message);
});
......
......@@ -225,7 +225,7 @@ void main() {
expect(messages, isNot(hasLength(0)));
expect(messages.every((dynamic message) => message['type'] == 'scroll'), isTrue);
Map<String, Object> message = messages.last['data'];
Map<Object, Object> message = messages.last['data'];
expect(message['axis'], 'v');
expect(message['pixels'], isPositive);
expect(message['minScrollExtent'], 0.0);
......@@ -271,7 +271,7 @@ void main() {
expect(messages, isNot(hasLength(0)));
expect(messages.every((dynamic message) => message['type'] == 'scroll'), isTrue);
Map<String, Object> message = messages.last['data'];
Map<Object, Object> message = messages.last['data'];
expect(message['axis'], 'h');
expect(message['pixels'], isPositive);
expect(message['minScrollExtent'], 0.0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment