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
2cd205bb
Unverified
Commit
2cd205bb
authored
Jun 22, 2020
by
Jonah Williams
Committed by
GitHub
Jun 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] cleanup fuchsia tests (#59997)
Cleanup fuchsia tests that failed under tester.
parent
eaf9ff73
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
31 deletions
+31
-31
fuchsia_device_test.dart
...tools/test/general.shard/fuchsia/fuchsia_device_test.dart
+31
-31
No files found.
packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart
View file @
2cd205bb
...
...
@@ -432,19 +432,18 @@ void main() {
});
group
(
'screenshot'
,
()
{
MockProcessManager
mockProcessManager
;
setUp
(()
{
mockProcessManager
=
MockProcessManager
();
});
test
(
'is supported on posix platforms'
,
()
{
testUsingContext
(
'is supported on posix platforms'
,
()
{
final
FuchsiaDevice
device
=
FuchsiaDevice
(
'id'
,
name:
'tester'
);
expect
(
device
.
supportsScreenshot
,
true
);
},
testOn:
'posix'
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
FakePlatform
(
operatingSystem:
'linux'
,
),
});
testUsingContext
(
'is not supported on Windows'
,
()
{
final
FuchsiaDevice
device
=
FuchsiaDevice
(
'id'
,
name:
'tester'
);
expect
(
device
.
supportsScreenshot
,
false
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
FakePlatform
(
...
...
@@ -458,12 +457,12 @@ void main() {
()
=>
device
.
takeScreenshot
(
globals
.
fs
.
file
(
'file.invalid'
)),
throwsA
(
equals
(
'file.invalid must be a .ppm file'
)),
);
}
,
testOn:
'posix'
);
});
testUsingContext
(
'takeScreenshot throws if screencap failed'
,
()
async
{
final
FuchsiaDevice
device
=
FuchsiaDevice
(
'0.0.0.0'
,
name:
'tester'
);
when
(
mockP
rocessManager
.
run
(
when
(
globals
.
p
rocessManager
.
run
(
const
<
String
>[
'ssh'
,
'-F'
,
...
...
@@ -480,19 +479,20 @@ void main() {
throwsA
(
equals
(
'Could not take a screenshot on device tester:
\n
<error-message>'
)),
);
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
ProcessManager:
()
=>
MockProcessManager
(),
FileSystem:
()
=>
MemoryFileSystem
.
test
(),
Platform:
()
=>
FakePlatform
(
environment:
<
String
,
String
>{
'FUCHSIA_SSH_CONFIG'
:
'/fuchsia/out/default/.ssh'
,
},
operatingSystem:
'linux'
,
),
}
,
testOn:
'posix'
);
});
testUsingContext
(
'takeScreenshot throws if scp failed'
,
()
async
{
final
FuchsiaDevice
device
=
FuchsiaDevice
(
'0.0.0.0'
,
name:
'tester'
);
when
(
mockP
rocessManager
.
run
(
when
(
globals
.
p
rocessManager
.
run
(
const
<
String
>[
'ssh'
,
'-F'
,
...
...
@@ -504,7 +504,7 @@ void main() {
environment:
anyNamed
(
'environment'
),
)).
thenAnswer
((
_
)
async
=>
ProcessResult
(
0
,
0
,
''
,
''
));
when
(
mockP
rocessManager
.
run
(
when
(
globals
.
p
rocessManager
.
run
(
const
<
String
>[
'scp'
,
'-F'
,
...
...
@@ -516,7 +516,7 @@ void main() {
environment:
anyNamed
(
'environment'
),
)).
thenAnswer
((
_
)
async
=>
ProcessResult
(
0
,
1
,
''
,
'<error-message>'
));
when
(
mockP
rocessManager
.
run
(
when
(
globals
.
p
rocessManager
.
run
(
const
<
String
>[
'ssh'
,
'-F'
,
...
...
@@ -533,19 +533,20 @@ void main() {
throwsA
(
equals
(
'Failed to copy screenshot from device:
\n
<error-message>'
)),
);
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
ProcessManager:
()
=>
MockProcessManager
(),
FileSystem:
()
=>
MemoryFileSystem
.
test
(),
Platform:
()
=>
FakePlatform
(
environment:
<
String
,
String
>{
'FUCHSIA_SSH_CONFIG'
:
'/fuchsia/out/default/.ssh'
,
},
operatingSystem:
'linux'
,
),
}
,
testOn:
'posix'
);
});
testUsingContext
(
"takeScreenshot prints error if can't delete file from device"
,
()
async
{
final
FuchsiaDevice
device
=
FuchsiaDevice
(
'0.0.0.0'
,
name:
'tester'
);
when
(
mockP
rocessManager
.
run
(
when
(
globals
.
p
rocessManager
.
run
(
const
<
String
>[
'ssh'
,
'-F'
,
...
...
@@ -557,7 +558,7 @@ void main() {
environment:
anyNamed
(
'environment'
),
)).
thenAnswer
((
_
)
async
=>
ProcessResult
(
0
,
0
,
''
,
''
));
when
(
mockP
rocessManager
.
run
(
when
(
globals
.
p
rocessManager
.
run
(
const
<
String
>[
'scp'
,
'-F'
,
...
...
@@ -569,7 +570,7 @@ void main() {
environment:
anyNamed
(
'environment'
),
)).
thenAnswer
((
_
)
async
=>
ProcessResult
(
0
,
0
,
''
,
''
));
when
(
mockP
rocessManager
.
run
(
when
(
globals
.
p
rocessManager
.
run
(
const
<
String
>[
'ssh'
,
'-F'
,
...
...
@@ -591,7 +592,8 @@ void main() {
contains
(
'Failed to delete screenshot.ppm from the device:
\n
<error-message>'
),
);
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
ProcessManager:
()
=>
MockProcessManager
(),
FileSystem:
()
=>
MemoryFileSystem
.
test
(),
Platform:
()
=>
FakePlatform
(
environment:
<
String
,
String
>{
'FUCHSIA_SSH_CONFIG'
:
'/fuchsia/out/default/.ssh'
,
...
...
@@ -603,7 +605,7 @@ void main() {
testUsingContext
(
'takeScreenshot returns'
,
()
async
{
final
FuchsiaDevice
device
=
FuchsiaDevice
(
'0.0.0.0'
,
name:
'tester'
);
when
(
mockP
rocessManager
.
run
(
when
(
globals
.
p
rocessManager
.
run
(
const
<
String
>[
'ssh'
,
'-F'
,
...
...
@@ -615,7 +617,7 @@ void main() {
environment:
anyNamed
(
'environment'
),
)).
thenAnswer
((
_
)
async
=>
ProcessResult
(
0
,
0
,
''
,
''
));
when
(
mockP
rocessManager
.
run
(
when
(
globals
.
p
rocessManager
.
run
(
const
<
String
>[
'scp'
,
'-F'
,
...
...
@@ -627,7 +629,7 @@ void main() {
environment:
anyNamed
(
'environment'
),
)).
thenAnswer
((
_
)
async
=>
ProcessResult
(
0
,
0
,
''
,
''
));
when
(
mockP
rocessManager
.
run
(
when
(
globals
.
p
rocessManager
.
run
(
const
<
String
>[
'ssh'
,
'-F'
,
...
...
@@ -639,20 +641,18 @@ void main() {
environment:
anyNamed
(
'environment'
),
)).
thenAnswer
((
_
)
async
=>
ProcessResult
(
0
,
0
,
''
,
''
));
try
{
await
device
.
takeScreenshot
(
globals
.
fs
.
file
(
'file.ppm'
));
}
on
Exception
catch
(
e
)
{
fail
(
'Unexpected exception:
$e
'
);
}
expect
(()
async
=>
await
device
.
takeScreenshot
(
globals
.
fs
.
file
(
'file.ppm'
)),
returnsNormally
);
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
ProcessManager:
()
=>
MockProcessManager
(),
FileSystem:
()
=>
MemoryFileSystem
.
test
(),
Platform:
()
=>
FakePlatform
(
environment:
<
String
,
String
>{
'FUCHSIA_SSH_CONFIG'
:
'/fuchsia/out/default/.ssh'
,
},
operatingSystem:
'linux'
,
),
}
,
testOn:
'posix'
);
});
});
group
(
'portForwarder'
,
()
{
...
...
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