mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
parent
0f900116f0
commit
e2cd78358f
@ -655,7 +655,7 @@ Future<Map<String, dynamic>> _deviceToMap(Device device) async {
|
||||
'id': device.id,
|
||||
'name': device.name,
|
||||
'platform': getNameForTargetPlatform(await device.targetPlatform),
|
||||
'emulator': device.isLocalEmulator
|
||||
'emulator': await device.isLocalEmulator,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:file/memory.dart';
|
||||
import 'package:flutter_tools/src/android/android_device.dart';
|
||||
import 'package:flutter_tools/src/base/common.dart';
|
||||
@ -242,7 +244,7 @@ void main() {
|
||||
testUsingContext('uses existing emulator', () async {
|
||||
withMockDevice();
|
||||
when(mockDevice.name).thenReturn('mock-simulator');
|
||||
when(mockDevice.isLocalEmulator).thenReturn(true);
|
||||
when(mockDevice.isLocalEmulator).thenReturn(new Future<bool>.value(true));
|
||||
|
||||
final Device device = await findTargetDevice();
|
||||
expect(device.name, 'mock-simulator');
|
||||
@ -254,7 +256,7 @@ void main() {
|
||||
testUsingContext('uses existing Android device if and there are no simulators', () async {
|
||||
mockDevice = new MockAndroidDevice();
|
||||
when(mockDevice.name).thenReturn('mock-android-device');
|
||||
when(mockDevice.isLocalEmulator).thenReturn(false);
|
||||
when(mockDevice.isLocalEmulator).thenReturn(new Future<bool>.value(false));
|
||||
withMockDevice(mockDevice);
|
||||
|
||||
final Device device = await findTargetDevice();
|
||||
|
Loading…
Reference in New Issue
Block a user