Unverified Commit 6fec8b36 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Remove mockito from windows_device_test (#76355)

parent 69775c5d
...@@ -384,7 +384,7 @@ void main() { ...@@ -384,7 +384,7 @@ void main() {
))); )));
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Artifacts: () => artifacts, Artifacts: () => artifacts,
Cache: () => mockCache, Cache: () => Cache.test(),
DeviceManager: () => mockDeviceManager, DeviceManager: () => mockDeviceManager,
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
......
...@@ -553,4 +553,3 @@ Future<BuildApkCommand> runBuildApkCommand( ...@@ -553,4 +553,3 @@ Future<BuildApkCommand> runBuildApkCommand(
class MockAndroidSdk extends Mock implements AndroidSdk {} class MockAndroidSdk extends Mock implements AndroidSdk {}
class MockProcessManager extends Mock implements ProcessManager {} class MockProcessManager extends Mock implements ProcessManager {}
class MockProcess extends Mock implements Process {}
...@@ -349,4 +349,3 @@ Matcher not(Matcher target){ ...@@ -349,4 +349,3 @@ Matcher not(Matcher target){
class MockAndroidSdk extends Mock implements AndroidSdk {} class MockAndroidSdk extends Mock implements AndroidSdk {}
class MockProcessManager extends Mock implements ProcessManager {} class MockProcessManager extends Mock implements ProcessManager {}
class MockProcess extends Mock implements Process {}
...@@ -14,7 +14,7 @@ import 'package:flutter_tools/src/project.dart'; ...@@ -14,7 +14,7 @@ import 'package:flutter_tools/src/project.dart';
import 'package:flutter_tools/src/windows/application_package.dart'; import 'package:flutter_tools/src/windows/application_package.dart';
import 'package:flutter_tools/src/windows/windows_device.dart'; import 'package:flutter_tools/src/windows/windows_device.dart';
import 'package:flutter_tools/src/windows/windows_workflow.dart'; import 'package:flutter_tools/src/windows/windows_workflow.dart';
import 'package:mockito/mockito.dart'; import 'package:test/fake.dart';
import '../../src/common.dart'; import '../../src/common.dart';
import '../../src/context.dart'; import '../../src/context.dart';
...@@ -116,17 +116,11 @@ void main() { ...@@ -116,17 +116,11 @@ void main() {
testWithoutContext('executablePathForDevice uses the correct package executable', () async { testWithoutContext('executablePathForDevice uses the correct package executable', () async {
final WindowsDevice windowsDevice = setUpWindowsDevice(); final WindowsDevice windowsDevice = setUpWindowsDevice();
final MockWindowsApp mockApp = MockWindowsApp(); final FakeWindowsApp fakeApp = FakeWindowsApp();
const String debugPath = 'debug/executable';
const String profilePath = 'profile/executable'; expect(windowsDevice.executablePathForDevice(fakeApp, BuildMode.debug), 'debug/executable');
const String releasePath = 'release/executable'; expect(windowsDevice.executablePathForDevice(fakeApp, BuildMode.profile), 'profile/executable');
when(mockApp.executable(BuildMode.debug)).thenReturn(debugPath); expect(windowsDevice.executablePathForDevice(fakeApp, BuildMode.release), 'release/executable');
when(mockApp.executable(BuildMode.profile)).thenReturn(profilePath);
when(mockApp.executable(BuildMode.release)).thenReturn(releasePath);
expect(windowsDevice.executablePathForDevice(mockApp, BuildMode.debug), debugPath);
expect(windowsDevice.executablePathForDevice(mockApp, BuildMode.profile), profilePath);
expect(windowsDevice.executablePathForDevice(mockApp, BuildMode.release), releasePath);
}); });
} }
...@@ -151,4 +145,7 @@ WindowsDevice setUpWindowsDevice({ ...@@ -151,4 +145,7 @@ WindowsDevice setUpWindowsDevice({
); );
} }
class MockWindowsApp extends Mock implements WindowsApp {} class FakeWindowsApp extends Fake implements WindowsApp {
@override
String executable(BuildMode buildMode) => '${buildMode.name}/executable';
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment