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
ed88d28d
Commit
ed88d28d
authored
Aug 15, 2019
by
Ingo Reinhart
Committed by
Jonah Williams
Aug 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use common emulator/device list (#38296)
parent
1033155f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
drive.dart
packages/flutter_tools/lib/src/commands/drive.dart
+1
-1
drive_test.dart
...flutter_tools/test/general.shard/commands/drive_test.dart
+16
-1
No files found.
packages/flutter_tools/lib/src/commands/drive.dart
View file @
ed88d28d
...
...
@@ -211,7 +211,7 @@ Future<Device> findTargetDevice() async {
return
null
;
}
else
if
(
devices
.
length
>
1
)
{
printStatus
(
'Found multiple connected devices:'
);
printStatus
(
devices
.
map
<
String
>((
Device
d
)
=>
' -
${d.name}
\n
'
).
join
(
''
)
);
await
Device
.
printDevices
(
devices
);
}
printStatus
(
'Using device
${devices.first.name}
.'
);
return
devices
.
first
;
...
...
packages/flutter_tools/test/general.shard/commands/drive_test.dart
View file @
ed88d28d
...
...
@@ -13,6 +13,7 @@ import 'package:flutter_tools/src/base/platform.dart';
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/drive.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:mockito/mockito.dart'
;
import
'../../src/common.dart'
;
...
...
@@ -261,9 +262,22 @@ void main() {
mockUnsupportedDevice
=
MockDevice
();
when
(
mockUnsupportedDevice
.
isSupportedForProject
(
any
))
.
thenReturn
(
false
);
when
(
mockUnsupportedDevice
.
isSupported
())
.
thenReturn
(
false
);
when
(
mockUnsupportedDevice
.
name
).
thenReturn
(
'mock-web'
);
when
(
mockUnsupportedDevice
.
id
).
thenReturn
(
'web-1'
);
when
(
mockUnsupportedDevice
.
targetPlatform
).
thenAnswer
((
_
)
=>
Future
<
TargetPlatform
>(()
=>
TargetPlatform
.
web_javascript
));
when
(
mockUnsupportedDevice
.
isLocalEmulator
).
thenAnswer
((
_
)
=>
Future
<
bool
>(()
=>
false
));
when
(
mockUnsupportedDevice
.
sdkNameAndVersion
).
thenAnswer
((
_
)
=>
Future
<
String
>(()
=>
'html5'
));
when
(
mockDevice
.
name
).
thenReturn
(
'mock-android-device'
);
when
(
mockDevice
.
id
).
thenReturn
(
'mad-28'
);
when
(
mockDevice
.
isSupported
())
.
thenReturn
(
true
);
when
(
mockDevice
.
isSupportedForProject
(
any
))
.
thenReturn
(
true
);
when
(
mockDevice
.
name
).
thenReturn
(
'mock-android-device'
);
when
(
mockDevice
.
targetPlatform
).
thenAnswer
((
_
)
=>
Future
<
TargetPlatform
>(()
=>
TargetPlatform
.
android_x64
));
when
(
mockDevice
.
isLocalEmulator
).
thenAnswer
((
_
)
=>
Future
<
bool
>(()
=>
false
));
when
(
mockDevice
.
sdkNameAndVersion
).
thenAnswer
((
_
)
=>
Future
<
String
>(()
=>
'sdk-28'
));
testDeviceManager
.
addDevice
(
mockDevice
);
testDeviceManager
.
addDevice
(
mockUnsupportedDevice
);
...
...
@@ -310,6 +324,7 @@ void main() {
});
Future
<
void
>
appStarterSetup
()
async
{
mockDevice
=
MockDevice
();
testDeviceManager
.
addDevice
(
mockDevice
);
final
MockDeviceLogReader
mockDeviceLogReader
=
MockDeviceLogReader
();
...
...
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