Null safety migration of packages/flutter_tools/test/commands.shard/hermetic, part 3/3 (#110709)
* Migrate packages/flutter_tools/test/commands.shard/hermetic, part 3/3 * Fix tests * Chris's comment
This commit is contained in:
parent
089d955156
commit
9dbc09de1f
@ -512,7 +512,7 @@ class RunCommand extends RunCommandBase {
|
||||
}
|
||||
|
||||
@visibleForTesting
|
||||
Future<ResidentRunner?> createRunner({
|
||||
Future<ResidentRunner> createRunner({
|
||||
required bool hotMode,
|
||||
required List<FlutterDevice> flutterDevices,
|
||||
required String? applicationBinaryPath,
|
||||
@ -669,12 +669,12 @@ class RunCommand extends RunCommandBase {
|
||||
),
|
||||
];
|
||||
|
||||
final ResidentRunner runner = await (createRunner(
|
||||
final ResidentRunner runner = await createRunner(
|
||||
applicationBinaryPath: applicationBinaryPath,
|
||||
flutterDevices: flutterDevices,
|
||||
flutterProject: flutterProject,
|
||||
hotMode: hotMode,
|
||||
) as FutureOr<ResidentRunner>);
|
||||
);
|
||||
|
||||
DateTime? appStartedTime;
|
||||
// Sync completer so the completing agent attaching to the resident doesn't
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:file/file.dart';
|
||||
import 'package:file/memory.dart';
|
||||
import 'package:flutter_tools/src/android/android_device.dart';
|
||||
@ -27,7 +25,7 @@ void main() {
|
||||
Cache.disableLocking();
|
||||
});
|
||||
|
||||
FileSystem fileSystem;
|
||||
late FileSystem fileSystem;
|
||||
setUp(() {
|
||||
fileSystem = MemoryFileSystem.test();
|
||||
fileSystem.file('pubspec.yaml').createSync(recursive: true);
|
||||
@ -114,7 +112,7 @@ class FakeApplicationPackageFactory extends Fake implements ApplicationPackageFa
|
||||
final ApplicationPackage app;
|
||||
|
||||
@override
|
||||
Future<ApplicationPackage> getPackageForPlatform(TargetPlatform platform, {BuildInfo buildInfo, File applicationBinary}) async {
|
||||
Future<ApplicationPackage> getPackageForPlatform(TargetPlatform platform, {BuildInfo? buildInfo, File? applicationBinary}) async {
|
||||
return app;
|
||||
}
|
||||
}
|
||||
@ -131,13 +129,13 @@ class FakeIOSDevice extends Fake implements IOSDevice {
|
||||
@override
|
||||
Future<bool> isAppInstalled(
|
||||
IOSApp app, {
|
||||
String userIdentifier,
|
||||
String? userIdentifier,
|
||||
}) async => false;
|
||||
|
||||
@override
|
||||
Future<bool> installApp(
|
||||
IOSApp app, {
|
||||
String userIdentifier,
|
||||
String? userIdentifier,
|
||||
}) async => true;
|
||||
}
|
||||
|
||||
@ -151,12 +149,12 @@ class FakeAndroidDevice extends Fake implements AndroidDevice {
|
||||
@override
|
||||
Future<bool> isAppInstalled(
|
||||
AndroidApk app, {
|
||||
String userIdentifier,
|
||||
String? userIdentifier,
|
||||
}) async => false;
|
||||
|
||||
@override
|
||||
Future<bool> installApp(
|
||||
AndroidApk app, {
|
||||
String userIdentifier,
|
||||
String? userIdentifier,
|
||||
}) async => true;
|
||||
}
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/base/common.dart';
|
||||
import 'package:flutter_tools/src/cache.dart';
|
||||
import 'package:flutter_tools/src/commands/logs.dart';
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/base/logger.dart';
|
||||
import 'package:flutter_tools/src/base/platform.dart';
|
||||
import 'package:flutter_tools/src/cache.dart';
|
||||
@ -16,7 +14,7 @@ import '../../src/fakes.dart';
|
||||
import '../../src/test_flutter_command_runner.dart';
|
||||
|
||||
void main() {
|
||||
FakeCache cache;
|
||||
late FakeCache cache;
|
||||
|
||||
setUp(() {
|
||||
cache = FakeCache();
|
||||
@ -429,7 +427,7 @@ class FakeCache extends Fake implements Cache {
|
||||
bool isUpToDateValue = false;
|
||||
bool clearedStampFiles = false;
|
||||
bool locked = false;
|
||||
Set<DevelopmentArtifact> artifacts;
|
||||
Set<DevelopmentArtifact>? artifacts;
|
||||
|
||||
@override
|
||||
Future<void> lock() async {
|
||||
@ -455,7 +453,7 @@ class FakeCache extends Fake implements Cache {
|
||||
}
|
||||
|
||||
@override
|
||||
Set<String> platformOverrideArtifacts;
|
||||
Set<String>? platformOverrideArtifacts;
|
||||
|
||||
@override
|
||||
bool includeAllPlatforms = false;
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:file/memory.dart';
|
||||
@ -24,18 +22,18 @@ import '../../src/context.dart';
|
||||
import '../../src/fake_devices.dart';
|
||||
|
||||
void main() {
|
||||
Daemon daemon;
|
||||
NotifyingLogger notifyingLogger;
|
||||
BufferLogger bufferLogger;
|
||||
FakeAndroidDevice fakeDevice;
|
||||
Daemon? daemon;
|
||||
late NotifyingLogger notifyingLogger;
|
||||
late BufferLogger bufferLogger;
|
||||
late FakeAndroidDevice fakeDevice;
|
||||
|
||||
FakeApplicationPackageFactory applicationPackageFactory;
|
||||
MemoryFileSystem memoryFileSystem;
|
||||
FakeProcessManager fakeProcessManager;
|
||||
late FakeApplicationPackageFactory applicationPackageFactory;
|
||||
late MemoryFileSystem memoryFileSystem;
|
||||
late FakeProcessManager fakeProcessManager;
|
||||
|
||||
group('ProxiedDevices', () {
|
||||
DaemonConnection serverDaemonConnection;
|
||||
DaemonConnection clientDaemonConnection;
|
||||
late DaemonConnection serverDaemonConnection;
|
||||
late DaemonConnection clientDaemonConnection;
|
||||
setUp(() {
|
||||
bufferLogger = BufferLogger.test();
|
||||
notifyingLogger = NotifyingLogger(verbose: false, parent: bufferLogger);
|
||||
@ -60,7 +58,7 @@ void main() {
|
||||
|
||||
tearDown(() async {
|
||||
if (daemon != null) {
|
||||
return daemon.shutdown();
|
||||
return daemon!.shutdown();
|
||||
}
|
||||
notifyingLogger.dispose();
|
||||
await serverDaemonConnection.dispose();
|
||||
@ -74,7 +72,7 @@ void main() {
|
||||
);
|
||||
fakeDevice = FakeAndroidDevice();
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
daemon!.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
discoverer.addDevice(fakeDevice);
|
||||
|
||||
final ProxiedDevices proxiedDevices = ProxiedDevices(clientDaemonConnection, logger: bufferLogger);
|
||||
@ -95,7 +93,7 @@ void main() {
|
||||
);
|
||||
fakeDevice = FakeAndroidDevice();
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
daemon!.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
discoverer.addDevice(fakeDevice);
|
||||
|
||||
final ProxiedDevices proxiedDevices = ProxiedDevices(clientDaemonConnection, logger: bufferLogger);
|
||||
@ -115,7 +113,7 @@ void main() {
|
||||
);
|
||||
fakeDevice = FakeAndroidDevice();
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
daemon!.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
discoverer.addDevice(fakeDevice);
|
||||
|
||||
final ProxiedDevices proxiedDevices = ProxiedDevices(clientDaemonConnection, logger: bufferLogger);
|
||||
@ -145,7 +143,7 @@ void main() {
|
||||
);
|
||||
fakeDevice = FakeAndroidDevice();
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
daemon!.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
discoverer.addDevice(fakeDevice);
|
||||
|
||||
final ProxiedDevices proxiedDevices = ProxiedDevices(clientDaemonConnection, logger: bufferLogger);
|
||||
@ -173,9 +171,9 @@ void main() {
|
||||
|
||||
expect(launchResult.started, true);
|
||||
// The returned observatoryUri was a forwarded port, so we cannot compare them directly.
|
||||
expect(launchResult.observatoryUri.path, observatoryUri.path);
|
||||
expect(launchResult.observatoryUri!.path, observatoryUri.path);
|
||||
|
||||
expect(applicationPackageFactory.applicationBinaryRequested.readAsStringSync(), 'dummy content');
|
||||
expect(applicationPackageFactory.applicationBinaryRequested!.readAsStringSync(), 'dummy content');
|
||||
expect(applicationPackageFactory.platformRequested, TargetPlatform.android_arm);
|
||||
|
||||
expect(fakeDevice.startAppPackage, applicationPackage);
|
||||
@ -197,7 +195,7 @@ void main() {
|
||||
);
|
||||
fakeDevice = FakeAndroidDevice();
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
daemon!.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
discoverer.addDevice(fakeDevice);
|
||||
|
||||
final ProxiedDevices proxiedDevices = ProxiedDevices(clientDaemonConnection, logger: bufferLogger);
|
||||
@ -230,7 +228,7 @@ class FakeDaemonStreams implements DaemonStreams {
|
||||
}
|
||||
|
||||
@override
|
||||
void send(Map<String, dynamic> message, [ List<int> binary ]) {
|
||||
void send(Map<String, dynamic> message, [ List<int>? binary ]) {
|
||||
outputs.add(DaemonMessage(message, binary != null ? Stream<List<int>>.value(binary) : null));
|
||||
}
|
||||
|
||||
@ -294,48 +292,48 @@ class FakeAndroidDevice extends Fake implements AndroidDevice {
|
||||
@override
|
||||
bool get supportsStartPaused => true;
|
||||
|
||||
BuildMode supportsRuntimeModeCalledBuildMode;
|
||||
BuildMode? supportsRuntimeModeCalledBuildMode;
|
||||
@override
|
||||
Future<bool> supportsRuntimeMode(BuildMode buildMode) async {
|
||||
supportsRuntimeModeCalledBuildMode = buildMode;
|
||||
return true;
|
||||
}
|
||||
|
||||
DeviceLogReader logReader;
|
||||
late DeviceLogReader logReader;
|
||||
@override
|
||||
FutureOr<DeviceLogReader> getLogReader({
|
||||
covariant ApplicationPackage app,
|
||||
covariant ApplicationPackage? app,
|
||||
bool includePastLogs = false,
|
||||
}) => logReader;
|
||||
|
||||
ApplicationPackage startAppPackage;
|
||||
LaunchResult launchResult;
|
||||
ApplicationPackage? startAppPackage;
|
||||
late LaunchResult launchResult;
|
||||
@override
|
||||
Future<LaunchResult> startApp(
|
||||
ApplicationPackage package, {
|
||||
String mainPath,
|
||||
String route,
|
||||
DebuggingOptions debuggingOptions,
|
||||
Map<String, Object> platformArgs = const <String, Object>{},
|
||||
String? mainPath,
|
||||
String? route,
|
||||
DebuggingOptions? debuggingOptions,
|
||||
Map<String, Object?> platformArgs = const <String, Object>{},
|
||||
bool prebuiltApplication = false,
|
||||
bool ipv6 = false,
|
||||
String userIdentifier,
|
||||
String? userIdentifier,
|
||||
}) async {
|
||||
startAppPackage = package;
|
||||
return launchResult;
|
||||
}
|
||||
|
||||
ApplicationPackage stopAppPackage;
|
||||
ApplicationPackage? stopAppPackage;
|
||||
@override
|
||||
Future<bool> stopApp(
|
||||
ApplicationPackage app, {
|
||||
String userIdentifier,
|
||||
String? userIdentifier,
|
||||
}) async {
|
||||
stopAppPackage = app;
|
||||
return true;
|
||||
}
|
||||
|
||||
List<int> screenshot;
|
||||
late List<int> screenshot;
|
||||
@override
|
||||
Future<void> takeScreenshot(File outputFile) {
|
||||
return outputFile.writeAsBytes(screenshot);
|
||||
@ -347,10 +345,10 @@ class FakeDeviceLogReader implements DeviceLogReader {
|
||||
bool disposeCalled = false;
|
||||
|
||||
@override
|
||||
int appPid;
|
||||
int? appPid;
|
||||
|
||||
@override
|
||||
FlutterVmService connectedVMService;
|
||||
FlutterVmService? connectedVMService;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@ -366,12 +364,12 @@ class FakeDeviceLogReader implements DeviceLogReader {
|
||||
}
|
||||
|
||||
class FakeApplicationPackageFactory implements ApplicationPackageFactory {
|
||||
TargetPlatform platformRequested;
|
||||
File applicationBinaryRequested;
|
||||
ApplicationPackage applicationPackage;
|
||||
TargetPlatform? platformRequested;
|
||||
File? applicationBinaryRequested;
|
||||
ApplicationPackage? applicationPackage;
|
||||
|
||||
@override
|
||||
Future<ApplicationPackage> getPackageForPlatform(TargetPlatform platform, {BuildInfo buildInfo, File applicationBinary}) async {
|
||||
Future<ApplicationPackage?> getPackageForPlatform(TargetPlatform platform, {BuildInfo? buildInfo, File? applicationBinary}) async {
|
||||
platformRequested = platform;
|
||||
applicationBinaryRequested = applicationBinary;
|
||||
return applicationPackage;
|
||||
@ -382,5 +380,5 @@ class FakeApplicationPackage extends Fake implements ApplicationPackage {}
|
||||
|
||||
class FakePrebuiltApplicationPackage extends Fake implements PrebuiltApplicationPackage {
|
||||
@override
|
||||
File applicationPackage;
|
||||
late File applicationPackage;
|
||||
}
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:file/file.dart';
|
||||
@ -31,7 +29,6 @@ import 'package:flutter_tools/src/reporting/reporting.dart';
|
||||
import 'package:flutter_tools/src/resident_runner.dart';
|
||||
import 'package:flutter_tools/src/runner/flutter_command.dart';
|
||||
import 'package:flutter_tools/src/vmservice.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:test/fake.dart';
|
||||
import 'package:vm_service/vm_service.dart';
|
||||
|
||||
@ -47,8 +44,8 @@ void main() {
|
||||
});
|
||||
|
||||
group('run', () {
|
||||
FakeDeviceManager mockDeviceManager;
|
||||
FileSystem fileSystem;
|
||||
late FakeDeviceManager mockDeviceManager;
|
||||
late FileSystem fileSystem;
|
||||
|
||||
setUp(() {
|
||||
mockDeviceManager = FakeDeviceManager();
|
||||
@ -142,10 +139,10 @@ void main() {
|
||||
});
|
||||
|
||||
group('run app', () {
|
||||
MemoryFileSystem fs;
|
||||
Artifacts artifacts;
|
||||
TestUsage usage;
|
||||
FakeAnsiTerminal fakeTerminal;
|
||||
late MemoryFileSystem fs;
|
||||
late Artifacts artifacts;
|
||||
late TestUsage usage;
|
||||
late FakeAnsiTerminal fakeTerminal;
|
||||
|
||||
setUpAll(() {
|
||||
Cache.disableLocking();
|
||||
@ -555,8 +552,8 @@ void main() {
|
||||
});
|
||||
|
||||
group('Fatal Logs', () {
|
||||
TestRunCommandWithFakeResidentRunner command;
|
||||
MemoryFileSystem fs;
|
||||
late TestRunCommandWithFakeResidentRunner command;
|
||||
late MemoryFileSystem fs;
|
||||
|
||||
setUp(() {
|
||||
command = TestRunCommandWithFakeResidentRunner()
|
||||
@ -666,7 +663,7 @@ void main() {
|
||||
});
|
||||
|
||||
group('dart-defines and web-renderer options', () {
|
||||
List<String> dartDefines;
|
||||
late List<String> dartDefines;
|
||||
|
||||
setUp(() {
|
||||
dartDefines = <String>[];
|
||||
@ -707,7 +704,7 @@ void main() {
|
||||
});
|
||||
|
||||
group('terminal', () {
|
||||
FakeAnsiTerminal fakeTerminal;
|
||||
late FakeAnsiTerminal fakeTerminal;
|
||||
|
||||
setUp(() {
|
||||
fakeTerminal = FakeAnsiTerminal();
|
||||
@ -877,7 +874,7 @@ void main() {
|
||||
expect(options.webLaunchUrl, 'http://flutter.dev');
|
||||
|
||||
final RegExp pattern = RegExp(r'^((http)?:\/\/)[^\s]+');
|
||||
expect(pattern.hasMatch(options.webLaunchUrl), true);
|
||||
expect(pattern.hasMatch(options.webLaunchUrl!), true);
|
||||
}, overrides: <Type, Generator>{
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
Logger: () => BufferLogger.test(),
|
||||
@ -889,7 +886,7 @@ class FakeDeviceManager extends Fake implements DeviceManager {
|
||||
List<Device> targetDevices = <Device>[];
|
||||
|
||||
@override
|
||||
String specifiedDeviceId;
|
||||
String? specifiedDeviceId;
|
||||
|
||||
@override
|
||||
bool hasSpecifiedAllDevices = false;
|
||||
@ -903,7 +900,7 @@ class FakeDeviceManager extends Fake implements DeviceManager {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<Device>> findTargetDevices(FlutterProject flutterProject, {Duration timeout}) async {
|
||||
Future<List<Device>> findTargetDevices(FlutterProject? flutterProject, {Duration? timeout}) async {
|
||||
return targetDevices;
|
||||
}
|
||||
|
||||
@ -950,7 +947,7 @@ class FakeDevice extends Fake implements Device {
|
||||
@override
|
||||
String get id => 'fake_device';
|
||||
|
||||
void _throwToolExit(int code) => throwToolExit('FakeDevice tool exit', exitCode: code);
|
||||
Never _throwToolExit(int code) => throwToolExit('FakeDevice tool exit', exitCode: code);
|
||||
|
||||
@override
|
||||
Future<bool> get isLocalEmulator => Future<bool>.value(_isLocalEmulator);
|
||||
@ -987,7 +984,7 @@ class FakeDevice extends Fake implements Device {
|
||||
|
||||
@override
|
||||
DeviceLogReader getLogReader({
|
||||
ApplicationPackage app,
|
||||
ApplicationPackage? app,
|
||||
bool includePastLogs = false,
|
||||
}) {
|
||||
return FakeDeviceLogReader();
|
||||
@ -1002,27 +999,27 @@ class FakeDevice extends Fake implements Device {
|
||||
@override
|
||||
PlatformType get platformType => _platformType;
|
||||
|
||||
bool startAppSuccess;
|
||||
late bool startAppSuccess;
|
||||
|
||||
@override
|
||||
DevFSWriter createDevFSWriter(
|
||||
covariant ApplicationPackage app,
|
||||
String userIdentifier,
|
||||
DevFSWriter? createDevFSWriter(
|
||||
covariant ApplicationPackage? app,
|
||||
String? userIdentifier,
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<LaunchResult> startApp(
|
||||
ApplicationPackage package, {
|
||||
String mainPath,
|
||||
String route,
|
||||
DebuggingOptions debuggingOptions,
|
||||
Map<String, dynamic> platformArgs,
|
||||
ApplicationPackage? package, {
|
||||
String? mainPath,
|
||||
String? route,
|
||||
required DebuggingOptions debuggingOptions,
|
||||
Map<String, Object?> platformArgs = const <String, Object?>{},
|
||||
bool prebuiltApplication = false,
|
||||
bool usesTerminalUi = true,
|
||||
bool ipv6 = false,
|
||||
String userIdentifier,
|
||||
String? userIdentifier,
|
||||
}) async {
|
||||
if (startAppSuccess == false) {
|
||||
return LaunchResult.failed();
|
||||
@ -1045,19 +1042,18 @@ class FakeDevice extends Fake implements Device {
|
||||
}
|
||||
_throwToolExit(kSuccess);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class TestRunCommandWithFakeResidentRunner extends RunCommand {
|
||||
FakeResidentRunner fakeResidentRunner;
|
||||
late FakeResidentRunner fakeResidentRunner;
|
||||
|
||||
@override
|
||||
Future<ResidentRunner> createRunner({
|
||||
@required bool hotMode,
|
||||
@required List<FlutterDevice> flutterDevices,
|
||||
@required String applicationBinaryPath,
|
||||
@required FlutterProject flutterProject,
|
||||
required bool hotMode,
|
||||
required List<FlutterDevice> flutterDevices,
|
||||
required String? applicationBinaryPath,
|
||||
required FlutterProject flutterProject,
|
||||
}) async {
|
||||
return fakeResidentRunner;
|
||||
}
|
||||
@ -1077,26 +1073,26 @@ class TestRunCommandThatOnlyValidates extends RunCommand {
|
||||
}
|
||||
|
||||
class FakeResidentRunner extends Fake implements ResidentRunner {
|
||||
RPCError rpcError;
|
||||
RPCError? rpcError;
|
||||
|
||||
@override
|
||||
Future<int> run({
|
||||
Completer<DebugConnectionInfo> connectionInfoCompleter,
|
||||
Completer<void> appStartedCompleter,
|
||||
Completer<DebugConnectionInfo>? connectionInfoCompleter,
|
||||
Completer<void>? appStartedCompleter,
|
||||
bool enableDevTools = false,
|
||||
String route,
|
||||
String? route,
|
||||
}) async {
|
||||
await null;
|
||||
if (rpcError != null) {
|
||||
throw rpcError;
|
||||
throw rpcError!;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
class DaemonCapturingRunCommand extends RunCommand {
|
||||
/*late*/ Daemon daemon;
|
||||
/*late*/ CapturingAppDomain appDomain;
|
||||
late Daemon daemon;
|
||||
late CapturingAppDomain appDomain;
|
||||
|
||||
@override
|
||||
Daemon createMachineDaemon() {
|
||||
@ -1108,29 +1104,29 @@ class DaemonCapturingRunCommand extends RunCommand {
|
||||
}
|
||||
|
||||
class CapturingAppDomain extends AppDomain {
|
||||
CapturingAppDomain(Daemon daemon) : super(daemon);
|
||||
CapturingAppDomain(super.daemon);
|
||||
|
||||
bool /*?*/ multidexEnabled;
|
||||
String /*?*/ userIdentifier;
|
||||
bool? multidexEnabled;
|
||||
String? userIdentifier;
|
||||
|
||||
@override
|
||||
Future<AppInstance> startApp(
|
||||
Device device,
|
||||
String projectDirectory,
|
||||
String target,
|
||||
String route,
|
||||
String? route,
|
||||
DebuggingOptions options,
|
||||
bool enableHotReload, {
|
||||
File applicationBinary,
|
||||
@required bool trackWidgetCreation,
|
||||
String projectRootPath,
|
||||
String packagesFilePath,
|
||||
String dillOutputPath,
|
||||
File? applicationBinary,
|
||||
required bool trackWidgetCreation,
|
||||
String? projectRootPath,
|
||||
String? packagesFilePath,
|
||||
String? dillOutputPath,
|
||||
bool ipv6 = false,
|
||||
bool multidexEnabled = false,
|
||||
String isolateFilter,
|
||||
String? isolateFilter,
|
||||
bool machine = true,
|
||||
String userIdentifier,
|
||||
String? userIdentifier,
|
||||
}) async {
|
||||
this.multidexEnabled = multidexEnabled;
|
||||
this.userIdentifier = userIdentifier;
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/base/io.dart';
|
||||
import 'package:flutter_tools/src/base/logger.dart';
|
||||
import 'package:flutter_tools/src/cache.dart';
|
||||
@ -23,7 +21,7 @@ void main() {
|
||||
testUsingContext('rasterizer and skia screenshots do not require a device', () async {
|
||||
// Throw a specific exception when attempting to make a VM Service connection to
|
||||
// verify that we've made it past the initial validation.
|
||||
openChannelForTesting = (String url, {CompressionOptions compression, Logger logger}) async {
|
||||
openChannelForTesting = (String url, {CompressionOptions? compression, Logger? logger}) async {
|
||||
expect(url, 'ws://localhost:8181/ws');
|
||||
throw Exception('dummy');
|
||||
};
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:file/memory.dart';
|
||||
import 'package:flutter_tools/src/base/common.dart';
|
||||
import 'package:flutter_tools/src/base/file_system.dart';
|
||||
@ -18,7 +16,7 @@ import '../../src/test_flutter_command_runner.dart';
|
||||
|
||||
void main() {
|
||||
group('shell_completion', () {
|
||||
FakeStdio fakeStdio;
|
||||
late FakeStdio fakeStdio;
|
||||
|
||||
setUp(() {
|
||||
Cache.disableLocking();
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:typed_data';
|
||||
|
||||
@ -15,7 +13,6 @@ import 'package:flutter_tools/src/base/terminal.dart';
|
||||
import 'package:flutter_tools/src/cache.dart';
|
||||
import 'package:flutter_tools/src/commands/symbolize.dart';
|
||||
import 'package:flutter_tools/src/convert.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:test/fake.dart';
|
||||
|
||||
import '../../src/common.dart';
|
||||
@ -24,8 +21,8 @@ import '../../src/fakes.dart';
|
||||
import '../../src/test_flutter_command_runner.dart';
|
||||
|
||||
void main() {
|
||||
MemoryFileSystem fileSystem;
|
||||
FakeStdio stdio;
|
||||
late MemoryFileSystem fileSystem;
|
||||
late FakeStdio stdio;
|
||||
|
||||
setUpAll(() {
|
||||
Cache.disableLocking();
|
||||
@ -154,9 +151,9 @@ void main() {
|
||||
class ThrowingDwarfSymbolizationService extends Fake implements DwarfSymbolizationService {
|
||||
@override
|
||||
Future<void> decode({
|
||||
@required Stream<List<int>> input,
|
||||
@required IOSink output,
|
||||
@required Uint8List symbols,
|
||||
required Stream<List<int>> input,
|
||||
required IOSink output,
|
||||
required Uint8List symbols,
|
||||
}) async {
|
||||
throwToolExit('test');
|
||||
}
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
@ -12,7 +10,8 @@ import 'package:file/memory.dart';
|
||||
import 'package:flutter_tools/src/base/common.dart';
|
||||
import 'package:flutter_tools/src/base/file_system.dart';
|
||||
import 'package:flutter_tools/src/base/logger.dart';
|
||||
import 'package:flutter_tools/src/build_info.dart';
|
||||
import 'package:flutter_tools/src/base/terminal.dart';
|
||||
import 'package:flutter_tools/src/base/user_messages.dart';
|
||||
import 'package:flutter_tools/src/cache.dart';
|
||||
import 'package:flutter_tools/src/commands/test.dart';
|
||||
import 'package:flutter_tools/src/device.dart';
|
||||
@ -22,7 +21,6 @@ import 'package:flutter_tools/src/test/runner.dart';
|
||||
import 'package:flutter_tools/src/test/test_time_recorder.dart';
|
||||
import 'package:flutter_tools/src/test/test_wrapper.dart';
|
||||
import 'package:flutter_tools/src/test/watcher.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
import '../../src/common.dart';
|
||||
import '../../src/context.dart';
|
||||
@ -59,8 +57,8 @@ final String _packageConfigContents = json.encode(<String, Object>{
|
||||
|
||||
void main() {
|
||||
Cache.disableLocking();
|
||||
MemoryFileSystem fs;
|
||||
LoggingLogger logger;
|
||||
late MemoryFileSystem fs;
|
||||
late LoggingLogger logger;
|
||||
|
||||
setUp(() {
|
||||
fs = MemoryFileSystem.test();
|
||||
@ -790,51 +788,47 @@ class FakeFlutterTestRunner implements FlutterTestRunner {
|
||||
FakeFlutterTestRunner(this.exitCode, [this.leastRunTime]);
|
||||
|
||||
int exitCode;
|
||||
Duration leastRunTime;
|
||||
bool lastEnableObservatoryValue;
|
||||
DebuggingOptions lastDebuggingOptionsValue;
|
||||
Duration? leastRunTime;
|
||||
bool? lastEnableObservatoryValue;
|
||||
late DebuggingOptions lastDebuggingOptionsValue;
|
||||
|
||||
@override
|
||||
Future<int> runTests(
|
||||
TestWrapper testWrapper,
|
||||
List<String> testFiles, {
|
||||
@required DebuggingOptions debuggingOptions,
|
||||
Directory workDir,
|
||||
required DebuggingOptions debuggingOptions,
|
||||
List<String> names = const <String>[],
|
||||
List<String> plainNames = const <String>[],
|
||||
String tags,
|
||||
String excludeTags,
|
||||
String? tags,
|
||||
String? excludeTags,
|
||||
bool enableObservatory = false,
|
||||
bool ipv6 = false,
|
||||
bool machine = false,
|
||||
String precompiledDillPath,
|
||||
Map<String, String> precompiledDillFiles,
|
||||
BuildMode buildMode,
|
||||
bool trackWidgetCreation = false,
|
||||
String? precompiledDillPath,
|
||||
Map<String, String>? precompiledDillFiles,
|
||||
bool updateGoldens = false,
|
||||
TestWatcher watcher,
|
||||
int concurrency,
|
||||
String testAssetDirectory,
|
||||
FlutterProject flutterProject,
|
||||
String icudtlPath,
|
||||
Directory coverageDirectory,
|
||||
TestWatcher? watcher,
|
||||
required int? concurrency,
|
||||
String? testAssetDirectory,
|
||||
FlutterProject? flutterProject,
|
||||
String? icudtlPath,
|
||||
Directory? coverageDirectory,
|
||||
bool web = false,
|
||||
String randomSeed,
|
||||
@override List<String> extraFrontEndOptions,
|
||||
String reporter,
|
||||
String timeout,
|
||||
String? randomSeed,
|
||||
String? reporter,
|
||||
String? timeout,
|
||||
bool runSkipped = false,
|
||||
int shardIndex,
|
||||
int totalShards,
|
||||
Device integrationTestDevice,
|
||||
String integrationTestUserIdentifier,
|
||||
TestTimeRecorder testTimeRecorder,
|
||||
int? shardIndex,
|
||||
int? totalShards,
|
||||
Device? integrationTestDevice,
|
||||
String? integrationTestUserIdentifier,
|
||||
TestTimeRecorder? testTimeRecorder,
|
||||
}) async {
|
||||
lastEnableObservatoryValue = enableObservatory;
|
||||
lastDebuggingOptionsValue = debuggingOptions;
|
||||
|
||||
if (leastRunTime != null) {
|
||||
await Future<void>.delayed(leastRunTime);
|
||||
await Future<void>.delayed(leastRunTime!);
|
||||
}
|
||||
|
||||
return exitCode;
|
||||
@ -842,7 +836,7 @@ class FakeFlutterTestRunner implements FlutterTestRunner {
|
||||
}
|
||||
|
||||
class FakePackageTest implements TestWrapper {
|
||||
List<String> lastArgs;
|
||||
List<String>? lastArgs;
|
||||
|
||||
@override
|
||||
Future<void> main(List<String> args) async {
|
||||
@ -857,7 +851,7 @@ class FakePackageTest implements TestWrapper {
|
||||
}
|
||||
|
||||
class _FakeDeviceManager extends DeviceManager {
|
||||
_FakeDeviceManager(this._connectedDevices);
|
||||
_FakeDeviceManager(this._connectedDevices) : super(logger: testLogger, terminal: Terminal.test(), userMessages: userMessages);
|
||||
|
||||
final List<Device> _connectedDevices;
|
||||
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:args/command_runner.dart';
|
||||
@ -20,12 +18,12 @@ import '../../src/fakes.dart' show FakeFlutterVersion;
|
||||
import '../../src/test_flutter_command_runner.dart';
|
||||
|
||||
void main() {
|
||||
FileSystem fileSystem;
|
||||
BufferLogger logger;
|
||||
FakeProcessManager processManager;
|
||||
late FileSystem fileSystem;
|
||||
late BufferLogger logger;
|
||||
late FakeProcessManager processManager;
|
||||
UpgradeCommand command;
|
||||
CommandRunner<void> runner;
|
||||
FlutterVersion flutterVersion;
|
||||
late CommandRunner<void> runner;
|
||||
late FlutterVersion flutterVersion;
|
||||
|
||||
setUpAll(() {
|
||||
Cache.disableLocking();
|
||||
|
Loading…
x
Reference in New Issue
Block a user