-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Migrate these tests to the "new" API #7189
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,16 @@ void main() { | |
required int mapId, | ||
required Future<dynamic>? Function(MethodCall call) handler, | ||
}) { | ||
maps | ||
.ensureChannelInitialized(mapId) | ||
.setMockMethodCallHandler((MethodCall methodCall) { | ||
log.add(methodCall.method); | ||
return handler(methodCall); | ||
}); | ||
final MethodChannel channel = maps.ensureChannelInitialized(mapId); | ||
_ambiguate(TestDefaultBinaryMessengerBinding.instance)! | ||
.defaultBinaryMessenger | ||
.setMockMethodCallHandler( | ||
channel, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Slight deviation of the pattern here, expected: _ambiguate(TestDefaultBinaryMessengerBinding.instance)!
.defaultBinaryMessenger
.setMockMethodCallhandler(
maps.ensureChannelInitialized(mapId), (MethodCall methodCall) {... (I think it's better extracting the channel to its own local, tbh) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. weird, i wonder why that happened. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, i think this was the file i ended up looking at first, before i automated it, so this was done by hand There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to clarify, did you want me to make the changes consistent, or should i just land it as-is? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (i'm going to mark this autosubmit for now given the repo merge, happy to land a separate PR if you think it's worth making the call sites more consistent) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Hixie nah, I just left these comments in case others wanted to look at what was "different" from the more automatic/mechanic changes. Thanks for landing this! |
||
(MethodCall methodCall) { | ||
log.add(methodCall.method); | ||
return handler(methodCall); | ||
}, | ||
); | ||
} | ||
|
||
Future<void> sendPlatformMessage( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what most of the changes on this PR look like: