android_device_stop_test.dart 1.04 KB
Newer Older
1 2 3 4
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6
// @dart = 2.8

7
import 'package:file/memory.dart';
8
import 'package:flutter_tools/src/android/android_device.dart';
9 10 11 12
import 'package:flutter_tools/src/android/android_sdk.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:mockito/mockito.dart';
13 14

import '../../src/common.dart';
15
import '../../src/context.dart';
16 17 18

void main() {
  testWithoutContext('AndroidDevice.stopApp handles a null ApplicationPackage', () async {
19 20 21 22 23 24 25
    final AndroidDevice androidDevice = AndroidDevice('1234',
      androidSdk: MockAndroidSdk(),
      fileSystem: MemoryFileSystem.test(),
      logger: BufferLogger.test(),
      platform: FakePlatform(operatingSystem: 'linux'),
      processManager: FakeProcessManager.any(),
    );
26 27 28 29

    expect(await androidDevice.stopApp(null), false);
  });
}
30 31

class MockAndroidSdk extends Mock implements AndroidSdk {}