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() {
)));
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
Cache: () => mockCache,
Cache: () => Cache.test(),
DeviceManager: () => mockDeviceManager,
FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(),
......
......@@ -553,4 +553,3 @@ Future<BuildApkCommand> runBuildApkCommand(
class MockAndroidSdk extends Mock implements AndroidSdk {}
class MockProcessManager extends Mock implements ProcessManager {}
class MockProcess extends Mock implements Process {}
......@@ -349,4 +349,3 @@ Matcher not(Matcher target){
class MockAndroidSdk extends Mock implements AndroidSdk {}
class MockProcessManager extends Mock implements ProcessManager {}
class MockProcess extends Mock implements Process {}
......@@ -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/windows_device.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/context.dart';
......@@ -116,17 +116,11 @@ void main() {
testWithoutContext('executablePathForDevice uses the correct package executable', () async {
final WindowsDevice windowsDevice = setUpWindowsDevice();
final MockWindowsApp mockApp = MockWindowsApp();
const String debugPath = 'debug/executable';
const String profilePath = 'profile/executable';
const String releasePath = 'release/executable';
when(mockApp.executable(BuildMode.debug)).thenReturn(debugPath);
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);
final FakeWindowsApp fakeApp = FakeWindowsApp();
expect(windowsDevice.executablePathForDevice(fakeApp, BuildMode.debug), 'debug/executable');
expect(windowsDevice.executablePathForDevice(fakeApp, BuildMode.profile), 'profile/executable');
expect(windowsDevice.executablePathForDevice(fakeApp, BuildMode.release), 'release/executable');
});
}
......@@ -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