Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
8522ec7e
Unverified
Commit
8522ec7e
authored
Dec 01, 2020
by
Jenn Magder
Committed by
GitHub
Dec 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validate empty observatory URI for screenshot (#71451)
parent
a5ee7f7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
screenshot.dart
packages/flutter_tools/lib/src/commands/screenshot.dart
+3
-0
screenshot_command_test.dart
...ter_tools/test/general.shard/screenshot_command_test.dart
+12
-2
No files found.
packages/flutter_tools/lib/src/commands/screenshot.dart
View file @
8522ec7e
...
...
@@ -77,6 +77,9 @@ class ScreenshotCommand extends FlutterCommand {
if
(
observatoryUri
==
null
)
{
throwToolExit
(
'Observatory URI must be specified for screenshot type
$screenshotType
'
);
}
if
(
observatoryUri
.
isEmpty
||
Uri
.
tryParse
(
observatoryUri
)
==
null
)
{
throwToolExit
(
'Observatory URI "
$observatoryUri
" is invalid'
);
}
}
}
...
...
packages/flutter_tools/test/general.shard/screenshot_command_test.dart
View file @
8522ec7e
...
...
@@ -15,8 +15,18 @@ void main() {
});
testUsingContext
(
'rasterizer and skia screenshots require observatory uri'
,
()
async
{
expect
(()
=>
ScreenshotCommand
.
validateOptions
(
'rasterizer'
,
null
,
null
),
throwsToolExit
());
expect
(()
=>
ScreenshotCommand
.
validateOptions
(
'skia'
,
null
,
null
),
throwsToolExit
());
expect
(
()
=>
ScreenshotCommand
.
validateOptions
(
'rasterizer'
,
null
,
null
),
throwsToolExit
(
message:
'Observatory URI must be specified for screenshot type rasterizer'
));
expect
(
()
=>
ScreenshotCommand
.
validateOptions
(
'skia'
,
null
,
null
),
throwsToolExit
(
message:
'Observatory URI must be specified for screenshot type skia'
));
expect
(()
=>
ScreenshotCommand
.
validateOptions
(
'skia'
,
null
,
''
),
throwsToolExit
(
message:
'Observatory URI "" is invalid'
));
});
testUsingContext
(
'device screenshots require device'
,
()
async
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment