From e2cd78358f3ef1ea307f25b35af55b37a13cfd7b Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Wed, 26 Apr 2017 13:14:31 -0700 Subject: [PATCH] Fix missing await (#9617) Fixes #9612 --- packages/flutter_tools/lib/src/commands/daemon.dart | 2 +- packages/flutter_tools/test/drive_test.dart | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/lib/src/commands/daemon.dart b/packages/flutter_tools/lib/src/commands/daemon.dart index 951a04495be..59eba865c9f 100644 --- a/packages/flutter_tools/lib/src/commands/daemon.dart +++ b/packages/flutter_tools/lib/src/commands/daemon.dart @@ -655,7 +655,7 @@ Future> _deviceToMap(Device device) async { 'id': device.id, 'name': device.name, 'platform': getNameForTargetPlatform(await device.targetPlatform), - 'emulator': device.isLocalEmulator + 'emulator': await device.isLocalEmulator, }; } diff --git a/packages/flutter_tools/test/drive_test.dart b/packages/flutter_tools/test/drive_test.dart index 8a1bb0db159..88ee80b5da1 100644 --- a/packages/flutter_tools/test/drive_test.dart +++ b/packages/flutter_tools/test/drive_test.dart @@ -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.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.value(false)); withMockDevice(mockDevice); final Device device = await findTargetDevice();