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
fdd1bf29
Unverified
Commit
fdd1bf29
authored
Oct 05, 2020
by
Danny Tuppeny
Committed by
GitHub
Oct 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle missing Android SDKs in getEmulators() (#67295)
parent
5e97eed8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
android_emulator.dart
packages/flutter_tools/lib/src/android/android_emulator.dart
+1
-1
emulator_test.dart
packages/flutter_tools/test/general.shard/emulator_test.dart
+22
-0
No files found.
packages/flutter_tools/lib/src/android/android_emulator.dart
View file @
fdd1bf29
...
@@ -56,7 +56,7 @@ class AndroidEmulators extends EmulatorDiscovery {
...
@@ -56,7 +56,7 @@ class AndroidEmulators extends EmulatorDiscovery {
/// Return the list of available emulator AVDs.
/// Return the list of available emulator AVDs.
Future
<
List
<
AndroidEmulator
>>
_getEmulatorAvds
()
async
{
Future
<
List
<
AndroidEmulator
>>
_getEmulatorAvds
()
async
{
final
String
emulatorPath
=
_androidSdk
.
emulatorPath
;
final
String
emulatorPath
=
_androidSdk
?
.
emulatorPath
;
if
(
emulatorPath
==
null
)
{
if
(
emulatorPath
==
null
)
{
return
<
AndroidEmulator
>[];
return
<
AndroidEmulator
>[];
}
}
...
...
packages/flutter_tools/test/general.shard/emulator_test.dart
View file @
fdd1bf29
...
@@ -84,6 +84,28 @@ void main() {
...
@@ -84,6 +84,28 @@ void main() {
returnsNormally
);
returnsNormally
);
});
});
testUsingContext
(
'getEmulators with no Android SDK'
,
()
async
{
// Test that EmulatorManager.getEmulators() doesn't throw when there's no Android SDK.
final
EmulatorManager
emulatorManager
=
EmulatorManager
(
fileSystem:
MemoryFileSystem
.
test
(),
logger:
BufferLogger
.
test
(),
processManager:
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'emulator'
,
'-list-avds'
],
stdout:
'existing-avd-1'
,
),
]),
androidSdk:
null
,
androidWorkflow:
AndroidWorkflow
(
androidSdk:
null
,
featureFlags:
TestFeatureFlags
(),
),
);
await
expectLater
(()
async
=>
await
emulatorManager
.
getAllAvailableEmulators
(),
returnsNormally
);
});
testWithoutContext
(
'getEmulatorsById'
,
()
async
{
testWithoutContext
(
'getEmulatorsById'
,
()
async
{
final
TestEmulatorManager
testEmulatorManager
=
TestEmulatorManager
(
emulators
);
final
TestEmulatorManager
testEmulatorManager
=
TestEmulatorManager
(
emulators
);
...
...
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