-
Notifications
You must be signed in to change notification settings - Fork 29.2k
[flutter_tools] dont require a device for screenshot type skia/rasterizer #80153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -87,8 +88,7 @@ class ScreenshotCommand extends FlutterCommand { | |||
|
|||
@override | |||
Future<FlutterCommandResult> verifyThenRunCommand(String commandPath) async { | |||
device = await findTargetDevice(); |
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 was the problem line
switch (screenshotType) { | ||
case _kDeviceType: | ||
device = await findTargetDevice(); | ||
if (device == null) { | ||
throwToolExit('Must have a connected device for screenshot type $screenshotType'); | ||
} |
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.
while you're at it you could throw if observatoryUri is non-null (see #80151)
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.
Done
|
||
await expectLater(() => createTestCommandRunner(ScreenshotCommand()) | ||
.run(<String>['screenshot', '--type=skia', '--observatory-uri=http://localhost:8181']), | ||
throwsException, |
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.
should we be checking what exception is thrown exactly? it seems like if this regressed, it would still actually throw an exception...
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.
Done
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.
Thanks for fixing this. Didn't mean to nerd-snipe you. :-) |
No worries :) I'm just happy to know what this command is supposed to be used for |
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.
LGTM
Ok |
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.
Ok
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.
Ok
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.
Ok
flutter screenshot does not require a device for rasterizer/skia. Move device lookup so that it only happens when the device type is selected. update unit tests to run more of the command logic.
Fixes #80149
Fixes #80151