|
|
|
|
@@ -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);
|
|
|
|
|
final FakeWindowsApp fakeApp = FakeWindowsApp();
|
|
|
|
|
|
|
|
|
|
expect(windowsDevice.executablePathForDevice(mockApp, BuildMode.debug), debugPath);
|
|
|
|
|
expect(windowsDevice.executablePathForDevice(mockApp, BuildMode.profile), profilePath);
|
|
|
|
|
expect(windowsDevice.executablePathForDevice(mockApp, BuildMode.release), releasePath);
|
|
|
|
|
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';
|
|
|
|
|
}
|
|
|
|
|
|