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
0a600e1d
Unverified
Commit
0a600e1d
authored
Jan 14, 2020
by
Dan Field
Committed by
GitHub
Jan 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tool test order (#48735)
parent
8b6b3b62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
drive_test.dart
...lutter_tools/test/commands.shard/hermetic/drive_test.dart
+14
-12
flutter_command_runner_test.dart
...est/general.shard/runner/flutter_command_runner_test.dart
+1
-0
No files found.
packages/flutter_tools/test/commands.shard/hermetic/drive_test.dart
View file @
0a600e1d
...
...
@@ -25,7 +25,6 @@ import '../../src/mocks.dart';
void
main
(
)
{
group
(
'drive'
,
()
{
DriveCommand
command
;
Device
mockDevice
;
Device
mockUnsupportedDevice
;
MemoryFileSystem
fs
;
Directory
tempDir
;
...
...
@@ -249,7 +248,7 @@ void main() {
group
(
'findTargetDevice'
,
()
{
testUsingContext
(
'uses specified device'
,
()
async
{
testDeviceManager
.
specifiedDeviceId
=
'123'
;
mockDevice
=
MockDevice
();
final
Device
mockDevice
=
MockDevice
();
testDeviceManager
.
addDevice
(
mockDevice
);
when
(
mockDevice
.
name
).
thenReturn
(
'specified-device'
);
when
(
mockDevice
.
id
).
thenReturn
(
'123'
);
...
...
@@ -274,7 +273,7 @@ void main() {
});
testUsingContext
(
'uses existing Android device'
,
()
async
{
mockDevice
=
MockAndroidDevice
();
final
Device
mockDevice
=
MockAndroidDevice
();
when
(
mockDevice
.
name
).
thenReturn
(
'mock-android-device'
);
testDeviceManager
.
addDevice
(
mockDevice
);
...
...
@@ -287,7 +286,7 @@ void main() {
});
testUsingContext
(
'skips unsupported device'
,
()
async
{
mockDevice
=
MockAndroidDevice
();
final
Device
mockDevice
=
MockAndroidDevice
();
mockUnsupportedDevice
=
MockDevice
();
when
(
mockUnsupportedDevice
.
isSupportedForProject
(
any
))
.
thenReturn
(
false
);
...
...
@@ -333,6 +332,7 @@ void main() {
Platform
macOsPlatform
()
=>
FakePlatform
(
operatingSystem:
'macos'
);
testUsingContext
(
'uses existing simulator'
,
()
async
{
final
Device
mockDevice
=
MockDevice
();
testDeviceManager
.
addDevice
(
mockDevice
);
when
(
mockDevice
.
name
).
thenReturn
(
'mock-simulator'
);
when
(
mockDevice
.
isLocalEmulator
)
...
...
@@ -354,8 +354,8 @@ void main() {
restoreAppStarter
();
});
Future
<
void
>
appStarterSetup
()
async
{
mockDevice
=
MockDevice
();
Future
<
Device
>
appStarterSetup
()
async
{
final
Device
mockDevice
=
MockDevice
();
testDeviceManager
.
addDevice
(
mockDevice
);
final
MockDeviceLogReader
mockDeviceLogReader
=
MockDeviceLogReader
();
...
...
@@ -388,10 +388,11 @@ void main() {
final
MemoryFileSystem
memFs
=
fs
;
await
memFs
.
file
(
testApp
).
writeAsString
(
'main() {}'
);
await
memFs
.
file
(
testFile
).
writeAsString
(
'main() {}'
);
return
mockDevice
;
}
testUsingContext
(
'does not use pre-built app if no build arg provided'
,
()
async
{
await
appStarterSetup
();
final
Device
mockDevice
=
await
appStarterSetup
();
final
List
<
String
>
args
=
<
String
>[
'drive'
,
...
...
@@ -418,7 +419,7 @@ void main() {
});
testUsingContext
(
'does not use pre-built app if --build arg provided'
,
()
async
{
await
appStarterSetup
();
final
Device
mockDevice
=
await
appStarterSetup
();
final
List
<
String
>
args
=
<
String
>[
'drive'
,
...
...
@@ -446,7 +447,7 @@ void main() {
});
testUsingContext
(
'uses prebuilt app if --no-build arg provided'
,
()
async
{
await
appStarterSetup
();
final
Device
mockDevice
=
await
appStarterSetup
();
final
List
<
String
>
args
=
<
String
>[
'drive'
,
...
...
@@ -483,8 +484,8 @@ void main() {
restoreAppStarter
();
});
Future
<
void
>
appStarterSetup
()
async
{
mockDevice
=
MockDevice
();
Future
<
Device
>
appStarterSetup
()
async
{
final
Device
mockDevice
=
MockDevice
();
testDeviceManager
.
addDevice
(
mockDevice
);
final
MockDeviceLogReader
mockDeviceLogReader
=
MockDeviceLogReader
();
...
...
@@ -521,6 +522,7 @@ void main() {
final
MemoryFileSystem
memFs
=
fs
;
await
memFs
.
file
(
testApp
).
writeAsString
(
'main() {}'
);
await
memFs
.
file
(
testFile
).
writeAsString
(
'main() {}'
);
return
mockDevice
;
}
void
_testOptionThatDefaultsToFalse
(
...
...
@@ -529,7 +531,7 @@ void main() {
bool
optionValue
(),
)
{
testUsingContext
(
'
$optionName
${setToTrue ? 'works' : 'defaults to false'}
'
,
()
async
{
await
appStarterSetup
();
final
Device
mockDevice
=
await
appStarterSetup
();
final
List
<
String
>
args
=
<
String
>[
'drive'
,
...
...
packages/flutter_tools/test/general.shard/runner/flutter_command_runner_test.dart
View file @
0a600e1d
...
...
@@ -35,6 +35,7 @@ void main() {
setUpAll
(()
{
Cache
.
disableLocking
();
Cache
.
flutterRoot
=
FlutterCommandRunner
.
defaultFlutterRoot
;
});
setUp
(()
{
...
...
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