Add and plumb useImplicitPubspecResolution across flutter_tools. (#157879)
Work towards https://github.com/flutter/flutter/issues/157819. **No behavior changes as a result of this PR**. Based on a proof of concept by @jonahwilliams (https://github.com/flutter/flutter/pull/157818). The existence of this flag (which for the time being, defaults to `true`) implies the following: 1. The (legacy, deprecated) `.flutter-plugins` file is not generated: https://docs.flutter.dev/release/breaking-changes/flutter-plugins-configuration 2. The (legacy, deprecated) `package:flutter_gen` is not synthetically generated: https://github.com/flutter/website/pull/11343 (awaiting website approvers, but owners approve this change) This change creates `useImplicitPubspecResolution` and plumbs it through as a required variable, parsing it from a `FlutterCommand.globalResults` where able. In tests, I've defaulted the value to `true` 100% of the time - except for places where the value itself is acted on directly, in which case there are true and false test-cases (e.g. localization and i10n based classes and functions). I'm not extremely happy this needed to change 50+ files, but is sort of a result of how inter-connected many of the elements of the tools are. I believe keeping this as an explicit (flagged) argument will be our best way to ensure the default behavior changes consistently and that tests are running as expected.
This commit is contained in:
@@ -1260,6 +1260,7 @@ class FakeHotRunnerFactory extends Fake implements HotRunnerFactory {
|
||||
Analytics? analytics,
|
||||
String? nativeAssetsYamlFile,
|
||||
HotRunnerNativeAssetsBuilder? nativeAssetsBuilder,
|
||||
required bool useImplicitPubspecResolution,
|
||||
}) {
|
||||
if (_artifactTester != null) {
|
||||
for (final FlutterDevice device in devices) {
|
||||
|
||||
@@ -99,6 +99,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'daemon.version'}));
|
||||
final DaemonMessage response = await daemonStreams.outputs.stream.firstWhere(_notEvent);
|
||||
@@ -111,6 +112,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
// Use the flutter_gallery project which has a known set of supported platforms.
|
||||
final String projectPath = globals.fs.path.join(getFlutterRoot(), 'dev', 'integration_tests', 'flutter_gallery');
|
||||
@@ -215,6 +217,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
globals.printError('daemon.logMessage test');
|
||||
final DaemonMessage response = await daemonStreams.outputs.stream.firstWhere((DaemonMessage message) {
|
||||
@@ -233,6 +236,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
globals.printWarning('daemon.logMessage test');
|
||||
final DaemonMessage response = await daemonStreams.outputs.stream.firstWhere((DaemonMessage message) {
|
||||
@@ -253,6 +257,7 @@ void main() {
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
logToStdout: true,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
globals.printStatus('daemon.logMessage test');
|
||||
return Future<void>.value();
|
||||
@@ -269,6 +274,7 @@ void main() {
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
logToStdout: true,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
globals.printBox('This is the box message', title: 'Sample title');
|
||||
return Future<void>.value();
|
||||
@@ -283,6 +289,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
notifyingLogger.notifyVerbose = false;
|
||||
globals.printTrace('daemon.logMessage test 1');
|
||||
@@ -304,6 +311,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
expect(notifyingLogger.notifyVerbose, false);
|
||||
|
||||
@@ -322,6 +330,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
notifyingLogger.notifyVerbose = false;
|
||||
|
||||
@@ -340,6 +349,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'daemon.shutdown'}));
|
||||
return daemon.onExit.then<void>((int code) async {
|
||||
@@ -352,6 +362,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'app.restart'}));
|
||||
@@ -364,6 +375,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{
|
||||
@@ -382,6 +394,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'app.stop'}));
|
||||
@@ -394,6 +407,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'device.getDevices'}));
|
||||
final DaemonMessage response = await daemonStreams.outputs.stream.firstWhere(_notEvent);
|
||||
@@ -405,6 +419,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
@@ -421,6 +436,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
@@ -434,6 +450,7 @@ void main() {
|
||||
previewBinary: fs.file(r'preview_device.exe'),
|
||||
artifacts: Artifacts.test(fileSystem: fs),
|
||||
builderFactory: () => throw UnimplementedError('TODO implement builder factory'),
|
||||
useImplicitPubspecResolution: true,
|
||||
));
|
||||
|
||||
final List<Map<String, Object?>> names = <Map<String, Object?>>[];
|
||||
@@ -504,6 +521,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'device.discoverDevices'}));
|
||||
final DaemonMessage response = await daemonStreams.outputs.stream.firstWhere(_notEvent);
|
||||
@@ -515,6 +533,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
@@ -532,6 +551,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
@@ -556,6 +576,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
@@ -607,6 +628,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
@@ -673,6 +695,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
@@ -732,6 +755,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final FakePollingDeviceDiscovery discoverer1 = FakePollingDeviceDiscovery();
|
||||
discoverer1.diagnostics = <String>['fake diagnostic 1', 'fake diagnostic 2'];
|
||||
@@ -757,6 +781,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'emulator.launch'}));
|
||||
@@ -769,6 +794,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final Map<String, Object?> params = <String, Object?>{'emulatorId': 'device', 'coldBoot': 1};
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'emulator.launch', 'params': params}));
|
||||
@@ -781,6 +807,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'emulator.getEmulators'}));
|
||||
final DaemonMessage response = await daemonStreams.outputs.stream.firstWhere(_notEvent);
|
||||
@@ -795,6 +822,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
// Respond to any requests from the daemon to expose a URL.
|
||||
@@ -814,6 +842,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'devtools.serve'}));
|
||||
@@ -830,6 +859,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'devtools.serve'}));
|
||||
@@ -860,6 +890,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'proxy.connect', 'params': <String, Object?>{'port': 123}}));
|
||||
|
||||
@@ -920,6 +951,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'proxy.connect', 'params': <String, Object?>{'port': 123}}));
|
||||
|
||||
@@ -940,6 +972,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
daemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'proxy.connect', 'params': <String, Object?>{'port': 123}}));
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ void main() {
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
});
|
||||
|
||||
testUsingContext('not using synthetic packages', () async {
|
||||
testUsingContext('not using synthetic packages (explicitly)', () async {
|
||||
final Directory l10nDirectory = fileSystem.directory(
|
||||
fileSystem.path.join('lib', 'l10n'),
|
||||
);
|
||||
@@ -104,6 +104,46 @@ flutter:
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
});
|
||||
|
||||
testUsingContext('not using synthetic packages (due to --no-implicit-pubspec-resolution)', () async {
|
||||
final Directory l10nDirectory = fileSystem.directory(
|
||||
fileSystem.path.join('lib', 'l10n'),
|
||||
);
|
||||
final File arbFile = l10nDirectory.childFile(
|
||||
'app_en.arb',
|
||||
)..createSync(recursive: true);
|
||||
|
||||
arbFile.writeAsStringSync('''
|
||||
{
|
||||
"helloWorld": "Hello, World!",
|
||||
"@helloWorld": {
|
||||
"description": "Sample description"
|
||||
}
|
||||
}''');
|
||||
fileSystem.file('pubspec.yaml').writeAsStringSync('''
|
||||
flutter:
|
||||
generate: true''');
|
||||
|
||||
final GenerateLocalizationsCommand command = GenerateLocalizationsCommand(
|
||||
fileSystem: fileSystem,
|
||||
logger: logger,
|
||||
artifacts: artifacts,
|
||||
processManager: processManager,
|
||||
);
|
||||
await createTestCommandRunner(command).run(<String>[
|
||||
'--no-implicit-pubspec-resolution',
|
||||
'gen-l10n',
|
||||
]);
|
||||
|
||||
expect(l10nDirectory.existsSync(), true);
|
||||
expect(l10nDirectory.childFile('app_localizations_en.dart').existsSync(),
|
||||
true);
|
||||
expect(
|
||||
l10nDirectory.childFile('app_localizations.dart').existsSync(), true);
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fileSystem,
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
});
|
||||
|
||||
testUsingContext('throws error when arguments are invalid', () async {
|
||||
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
|
||||
..createSync(recursive: true);
|
||||
|
||||
@@ -71,6 +71,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
serverDaemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
fakeDevice = FakeAndroidDevice();
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
@@ -92,6 +93,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
serverDaemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
fakeDevice = FakeAndroidDevice();
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
@@ -114,6 +116,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
serverDaemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
fakeDevice = FakeAndroidDevice();
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
@@ -144,6 +147,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
serverDaemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
fakeDevice = FakeAndroidDevice();
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
@@ -197,6 +201,7 @@ void main() {
|
||||
daemon = Daemon(
|
||||
serverDaemonConnection,
|
||||
notifyingLogger: notifyingLogger,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
fakeDevice = FakeAndroidDevice();
|
||||
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
|
||||
|
||||
@@ -1584,14 +1584,14 @@ class DaemonCapturingRunCommand extends RunCommand {
|
||||
@override
|
||||
Daemon createMachineDaemon() {
|
||||
daemon = super.createMachineDaemon();
|
||||
appDomain = daemon.appDomain = CapturingAppDomain(daemon);
|
||||
appDomain = daemon.appDomain = CapturingAppDomain(daemon, useImplicitPubspecResolution: true);
|
||||
daemon.registerDomain(appDomain);
|
||||
return daemon;
|
||||
}
|
||||
}
|
||||
|
||||
class CapturingAppDomain extends AppDomain {
|
||||
CapturingAppDomain(super.daemon);
|
||||
CapturingAppDomain(super.daemon, {required super.useImplicitPubspecResolution});
|
||||
|
||||
String? userIdentifier;
|
||||
bool? enableDevTools;
|
||||
|
||||
@@ -544,5 +544,6 @@ class FakeBundleBuilder extends Fake implements BundleBuilder {
|
||||
String? assetDirPath,
|
||||
bool buildNativeAssets = true,
|
||||
@visibleForTesting BuildSystem? buildSystem,
|
||||
required bool useImplicitPubspecResolution,
|
||||
}) async {}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ nullable-getter: false
|
||||
file: configFile,
|
||||
logger: BufferLogger.test(),
|
||||
defaultArbDir: fileSystem.path.join('lib', 'l10n'),
|
||||
defaultSyntheticPackage: true,
|
||||
);
|
||||
|
||||
expect(options.arbDir, Uri.parse('arb').path);
|
||||
@@ -69,6 +70,65 @@ nullable-getter: false
|
||||
expect(options.nullableGetter, false);
|
||||
});
|
||||
|
||||
testWithoutContext(
|
||||
'parseLocalizationsOptions uses defaultSyntheticPackage = true', () async {
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
final File configFile = fileSystem.file('l10n.yaml')..writeAsStringSync('''
|
||||
arb-dir: arb
|
||||
template-arb-file: example.arb
|
||||
output-localization-file: bar
|
||||
untranslated-messages-file: untranslated
|
||||
output-class: Foo
|
||||
header-file: header
|
||||
header: HEADER
|
||||
use-deferred-loading: true
|
||||
preferred-supported-locales: en_US
|
||||
# Intentionally omitted
|
||||
# synthetic-package: ...
|
||||
required-resource-attributes: false
|
||||
nullable-getter: false
|
||||
''');
|
||||
|
||||
final LocalizationOptions options = parseLocalizationsOptionsFromYAML(
|
||||
file: configFile,
|
||||
logger: BufferLogger.test(),
|
||||
defaultArbDir: fileSystem.path.join('lib', 'l10n'),
|
||||
defaultSyntheticPackage: true,
|
||||
);
|
||||
|
||||
expect(options.syntheticPackage, true);
|
||||
});
|
||||
|
||||
testWithoutContext(
|
||||
'parseLocalizationsOptions uses defaultSyntheticPackage = false',
|
||||
() async {
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
final File configFile = fileSystem.file('l10n.yaml')..writeAsStringSync('''
|
||||
arb-dir: arb
|
||||
template-arb-file: example.arb
|
||||
output-localization-file: bar
|
||||
untranslated-messages-file: untranslated
|
||||
output-class: Foo
|
||||
header-file: header
|
||||
header: HEADER
|
||||
use-deferred-loading: true
|
||||
preferred-supported-locales: en_US
|
||||
# Intentionally omitted
|
||||
# synthetic-package: ...
|
||||
required-resource-attributes: false
|
||||
nullable-getter: false
|
||||
''');
|
||||
|
||||
final LocalizationOptions options = parseLocalizationsOptionsFromYAML(
|
||||
file: configFile,
|
||||
logger: BufferLogger.test(),
|
||||
defaultArbDir: fileSystem.path.join('lib', 'l10n'),
|
||||
defaultSyntheticPackage: false,
|
||||
);
|
||||
|
||||
expect(options.syntheticPackage, false);
|
||||
});
|
||||
|
||||
testWithoutContext('parseLocalizationsOptions handles preferredSupportedLocales as list', () async {
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
final File configFile = fileSystem.file('l10n.yaml')..writeAsStringSync('''
|
||||
@@ -79,6 +139,7 @@ preferred-supported-locales: ['en_US', 'de']
|
||||
file: configFile,
|
||||
logger: BufferLogger.test(),
|
||||
defaultArbDir: fileSystem.path.join('lib', 'l10n'),
|
||||
defaultSyntheticPackage: true,
|
||||
);
|
||||
|
||||
expect(options.preferredSupportedLocales, <String>['en_US', 'de']);
|
||||
@@ -97,6 +158,7 @@ use-deferred-loading: string
|
||||
file: configFile,
|
||||
logger: BufferLogger.test(),
|
||||
defaultArbDir: fileSystem.path.join('lib', 'l10n'),
|
||||
defaultSyntheticPackage: true,
|
||||
),
|
||||
throwsException,
|
||||
);
|
||||
@@ -113,6 +175,7 @@ template-arb-file: {name}_en.arb
|
||||
file: configFile,
|
||||
logger: BufferLogger.test(),
|
||||
defaultArbDir: fileSystem.path.join('lib', 'l10n'),
|
||||
defaultSyntheticPackage: true,
|
||||
),
|
||||
throwsToolExit(),
|
||||
);
|
||||
|
||||
@@ -47,7 +47,8 @@ void main() {
|
||||
mainPath: globals.fs.path.join('lib', 'main.dart'),
|
||||
assetDirPath: 'example',
|
||||
depfilePath: 'example.d',
|
||||
buildSystem: buildSystem
|
||||
buildSystem: buildSystem,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
expect(globals.fs.file(globals.fs.path.join('example', 'kernel_blob.bin')).existsSync(), true);
|
||||
expect(globals.fs.file(globals.fs.path.join('example', 'LICENSE')).existsSync(), true);
|
||||
@@ -136,7 +137,8 @@ void main() {
|
||||
mainPath: 'lib/main.dart',
|
||||
assetDirPath: 'example',
|
||||
depfilePath: 'example.d',
|
||||
buildSystem: TestBuildSystem.all(BuildResult(success: false))
|
||||
buildSystem: TestBuildSystem.all(BuildResult(success: false)),
|
||||
useImplicitPubspecResolution: true,
|
||||
),
|
||||
throwsToolExit()
|
||||
);
|
||||
@@ -181,7 +183,8 @@ void main() {
|
||||
mainPath: mainPath,
|
||||
assetDirPath: assetDirPath,
|
||||
depfilePath: depfilePath,
|
||||
buildSystem: buildSystem
|
||||
buildSystem: buildSystem,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(env, isNotNull);
|
||||
|
||||
@@ -42,6 +42,7 @@ void main() {
|
||||
final int exitCode = await ColdRunner(devices,
|
||||
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
|
||||
target: 'main.dart',
|
||||
useImplicitPubspecResolution: true,
|
||||
).attach();
|
||||
expect(exitCode, 2);
|
||||
});
|
||||
@@ -58,6 +59,7 @@ void main() {
|
||||
await ColdRunner(devices,
|
||||
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
|
||||
target: 'main.dart',
|
||||
useImplicitPubspecResolution: true,
|
||||
).cleanupAtFinish();
|
||||
|
||||
expect(flutterDevice1.stopEchoingDeviceLogCount, 1);
|
||||
@@ -87,6 +89,7 @@ void main() {
|
||||
applicationBinary: applicationBinary,
|
||||
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
|
||||
target: 'main.dart',
|
||||
useImplicitPubspecResolution: true,
|
||||
).run();
|
||||
|
||||
expect(result, 1);
|
||||
@@ -103,6 +106,7 @@ void main() {
|
||||
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
|
||||
target: 'main.dart',
|
||||
traceStartup: true,
|
||||
useImplicitPubspecResolution: true,
|
||||
).run();
|
||||
|
||||
expect(result, 0);
|
||||
@@ -126,6 +130,7 @@ void main() {
|
||||
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
|
||||
target: 'main.dart',
|
||||
traceStartup: true,
|
||||
useImplicitPubspecResolution: true,
|
||||
).run();
|
||||
|
||||
expect(result, 0);
|
||||
|
||||
@@ -29,6 +29,7 @@ void main() {
|
||||
bindPorts.add(port);
|
||||
return socket;
|
||||
},
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
await server.run();
|
||||
expect(bindCalledTimes, 1);
|
||||
@@ -56,6 +57,7 @@ void main() {
|
||||
}
|
||||
return socket;
|
||||
},
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
await server.run();
|
||||
expect(bindCalledTimes, 2);
|
||||
|
||||
@@ -122,7 +122,8 @@ void main() {
|
||||
final CustomDevice device = CustomDevice(
|
||||
config: testConfig,
|
||||
processManager: FakeProcessManager.any(),
|
||||
logger: BufferLogger.test()
|
||||
logger: BufferLogger.test(),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
final PrebuiltLinuxApp linuxApp = PrebuiltLinuxApp(executable: 'foo');
|
||||
@@ -165,7 +166,8 @@ void main() {
|
||||
fileSystem: fs,
|
||||
directory: dir,
|
||||
logger: BufferLogger.test()
|
||||
)
|
||||
),
|
||||
useImplicitPubspecResolution: true,
|
||||
).devices(), <Device>[]);
|
||||
});
|
||||
|
||||
@@ -183,7 +185,8 @@ void main() {
|
||||
fileSystem: fs,
|
||||
directory: dir,
|
||||
logger: BufferLogger.test()
|
||||
)
|
||||
),
|
||||
useImplicitPubspecResolution: true,
|
||||
).devices(), <Device>[]);
|
||||
});
|
||||
|
||||
@@ -207,7 +210,8 @@ void main() {
|
||||
fileSystem: fs,
|
||||
directory: dir,
|
||||
logger: BufferLogger.test()
|
||||
)
|
||||
),
|
||||
useImplicitPubspecResolution: true,
|
||||
).devices(),
|
||||
hasLength(1)
|
||||
);
|
||||
@@ -236,6 +240,7 @@ void main() {
|
||||
directory: dir,
|
||||
logger: BufferLogger.test(),
|
||||
),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
final List<Device> discoveredDevices = await discovery.discoverDevices();
|
||||
@@ -265,6 +270,7 @@ void main() {
|
||||
directory: dir,
|
||||
logger: BufferLogger.test(),
|
||||
),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(await discovery.discoverDevices(), hasLength(0));
|
||||
@@ -289,6 +295,7 @@ void main() {
|
||||
directory: dir,
|
||||
logger: BufferLogger.test(),
|
||||
),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(await discovery.discoverDevices(), hasLength(0));
|
||||
@@ -308,6 +315,7 @@ void main() {
|
||||
config: testConfig,
|
||||
logger: BufferLogger.test(),
|
||||
processManager: FakeProcessManager.any(),
|
||||
useImplicitPubspecResolution: true,
|
||||
).isSupportedForProject(flutterProject), true);
|
||||
});
|
||||
|
||||
@@ -317,12 +325,13 @@ void main() {
|
||||
bool bothCommandsWereExecuted = false;
|
||||
|
||||
final CustomDevice device = CustomDevice(
|
||||
config: testConfig,
|
||||
logger: BufferLogger.test(),
|
||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||
FakeCommand(command: testConfig.uninstallCommand),
|
||||
FakeCommand(command: testConfig.installCommand, onRun: (_) => bothCommandsWereExecuted = true),
|
||||
])
|
||||
config: testConfig,
|
||||
logger: BufferLogger.test(),
|
||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||
FakeCommand(command: testConfig.uninstallCommand),
|
||||
FakeCommand(command: testConfig.installCommand, onRun: (_) => bothCommandsWereExecuted = true),
|
||||
]),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(await device.installApp(PrebuiltLinuxApp(executable: 'exe')), true);
|
||||
@@ -384,7 +393,8 @@ void main() {
|
||||
device: CustomDevice(
|
||||
config: testConfig,
|
||||
logger: BufferLogger.test(),
|
||||
processManager: processManager
|
||||
processManager: processManager,
|
||||
useImplicitPubspecResolution: true,
|
||||
),
|
||||
appPackage: PrebuiltLinuxApp(executable: 'testexecutable'),
|
||||
logger: BufferLogger.test(),
|
||||
@@ -421,7 +431,8 @@ void main() {
|
||||
device: CustomDevice(
|
||||
config: testConfigNonForwarding,
|
||||
logger: BufferLogger.test(),
|
||||
processManager: processManager
|
||||
processManager: processManager,
|
||||
useImplicitPubspecResolution: true,
|
||||
),
|
||||
appPackage: PrebuiltLinuxApp(executable: 'testexecutable'),
|
||||
logger: BufferLogger.test(),
|
||||
@@ -486,7 +497,8 @@ void main() {
|
||||
fileSystem: fs,
|
||||
directory: configFileDir,
|
||||
logger: BufferLogger.test()
|
||||
)
|
||||
),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
final List<Device> devices = await customDevices.discoverDevices();
|
||||
@@ -535,7 +547,8 @@ void main() {
|
||||
final CustomDevice device = CustomDevice(
|
||||
config: testConfig,
|
||||
logger: BufferLogger.test(),
|
||||
processManager: processManager
|
||||
processManager: processManager,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(device.supportsScreenshot, true);
|
||||
@@ -563,7 +576,8 @@ void main() {
|
||||
explicitScreenshotCommand: true
|
||||
),
|
||||
logger: BufferLogger.test(),
|
||||
processManager: processManager
|
||||
processManager: processManager,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(device.supportsScreenshot, false);
|
||||
@@ -581,7 +595,8 @@ void main() {
|
||||
platform: TargetPlatform.linux_x64
|
||||
),
|
||||
logger: BufferLogger.test(),
|
||||
processManager: FakeProcessManager.empty()
|
||||
processManager: FakeProcessManager.empty(),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(await device.targetPlatform, TargetPlatform.linux_x64);
|
||||
@@ -649,6 +664,7 @@ class FakeBundleBuilder extends Fake implements BundleBuilder {
|
||||
String? assetDirPath,
|
||||
Uri? nativeAssets,
|
||||
bool buildNativeAssets = true,
|
||||
required bool useImplicitPubspecResolution,
|
||||
@visibleForTesting BuildSystem? buildSystem
|
||||
}) async {}
|
||||
}
|
||||
|
||||
@@ -318,6 +318,7 @@ class FakeWebRunnerFactory implements WebRunnerFactory {
|
||||
Usage? usage,
|
||||
Analytics? analytics,
|
||||
bool machine = false,
|
||||
required bool useImplicitPubspecResolution,
|
||||
}) {
|
||||
expect(stayResident, isTrue);
|
||||
return FakeResidentRunner(
|
||||
@@ -381,6 +382,7 @@ WebDriverService setUpDriverService() {
|
||||
processManager: FakeProcessManager.any(),
|
||||
),
|
||||
dartSdkPath: 'dart',
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -149,6 +149,7 @@ void main() {
|
||||
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
analytics: fakeAnalytics,
|
||||
).restart(fullRestart: true);
|
||||
expect(result.isOk, false);
|
||||
@@ -181,6 +182,7 @@ void main() {
|
||||
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
reassembleHelper: (
|
||||
List<FlutterDevice?> flutterDevices,
|
||||
Map<FlutterDevice?, List<FlutterView>> viewCache,
|
||||
@@ -230,6 +232,7 @@ void main() {
|
||||
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
|
||||
target: 'main.dart',
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
).cleanupAfterSignal();
|
||||
expect(shutdownTestingConfig.shutdownHookCalled, true);
|
||||
}, overrides: <Type, Generator>{
|
||||
@@ -258,6 +261,7 @@ void main() {
|
||||
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
|
||||
target: 'main.dart',
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
).preExit();
|
||||
expect(shutdownTestingConfig.shutdownHookCalled, true);
|
||||
}, overrides: <Type, Generator>{
|
||||
@@ -308,6 +312,7 @@ void main() {
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
stopwatchFactory: fakeStopwatchFactory,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
).restart(fullRestart: true);
|
||||
|
||||
expect(result.isOk, true);
|
||||
@@ -395,6 +400,7 @@ void main() {
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
stopwatchFactory: fakeStopwatchFactory,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
reloadSourcesHelper: (
|
||||
HotRunner hotRunner,
|
||||
List<FlutterDevice?> flutterDevices,
|
||||
@@ -501,6 +507,7 @@ void main() {
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
await expectLater(runner.restart(fullRestart: true), throwsA(isA<Exception>().having((Exception e) => e.toString(), 'message', 'Exception: updateDevFS failed')));
|
||||
@@ -536,6 +543,7 @@ void main() {
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
await expectLater(runner.restart(), throwsA(isA<Exception>().having((Exception e) => e.toString(), 'message', 'Exception: updateDevFS failed')));
|
||||
@@ -589,6 +597,7 @@ void main() {
|
||||
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
|
||||
target: 'main.dart',
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
).attach(needsFullRestart: false);
|
||||
expect(exitCode, 2);
|
||||
}, overrides: <Type, Generator>{
|
||||
@@ -627,6 +636,7 @@ void main() {
|
||||
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
|
||||
target: 'main.dart',
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
).cleanupAtFinish();
|
||||
|
||||
expect(device1.disposed, true);
|
||||
|
||||
@@ -89,6 +89,7 @@ void main() {
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
nativeAssetsBuilder: FakeHotRunnerNativeAssetsBuilder(buildRunner),
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final OperationResult result = await hotRunner.restart(fullRestart: true);
|
||||
expect(result.isOk, true);
|
||||
@@ -157,6 +158,7 @@ void main() {
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
nativeAssetsBuilder: FakeHotRunnerNativeAssetsBuilder(buildRunner),
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
expect(
|
||||
() => hotRunner.run(),
|
||||
|
||||
@@ -74,6 +74,7 @@ void main() {
|
||||
nativeAssetsBuilder: FakeHotRunnerNativeAssetsBuilder(buildRunner),
|
||||
analytics: FakeAnalytics(),
|
||||
nativeAssetsYamlFile: 'foo.yaml',
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
final int result = await residentRunner.run();
|
||||
|
||||
@@ -49,6 +49,7 @@ void main() {
|
||||
processManager: FakeProcessManager.any(),
|
||||
previewBinary: previewBinary,
|
||||
logger: BufferLogger.test(),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(await device.isLocalEmulator, false);
|
||||
@@ -84,6 +85,7 @@ void main() {
|
||||
]),
|
||||
logger: logger,
|
||||
builderFactory: () => FakeBundleBuilder(fs),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final Directory previewDeviceCacheDir = fs
|
||||
.directory('Artifact.windowsDesktopPath.TargetPlatform.windows_x64.debug')
|
||||
@@ -121,6 +123,7 @@ void main() {
|
||||
processManager: processManager,
|
||||
platform: linuxPlatform,
|
||||
featureFlags: featureFlags,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
final List<Device> devices = await discovery.devices();
|
||||
@@ -136,6 +139,7 @@ void main() {
|
||||
processManager: processManager,
|
||||
platform: macPlatform,
|
||||
featureFlags: featureFlags,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
final List<Device> devices = await discovery.devices();
|
||||
@@ -153,6 +157,7 @@ void main() {
|
||||
processManager: processManager,
|
||||
platform: windowsPlatform,
|
||||
featureFlags: featureFlags,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
final List<Device> devices = await discovery.devices();
|
||||
@@ -170,6 +175,7 @@ void main() {
|
||||
processManager: processManager,
|
||||
platform: windowsPlatform,
|
||||
featureFlags: featureFlags,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
final List<Device> devices = await discovery.devices();
|
||||
@@ -197,7 +203,8 @@ class FakeBundleBuilder extends Fake implements BundleBuilder {
|
||||
String? depfilePath,
|
||||
String? assetDirPath,
|
||||
bool buildNativeAssets = true,
|
||||
@visibleForTesting BuildSystem? buildSystem
|
||||
@visibleForTesting BuildSystem? buildSystem,
|
||||
required bool useImplicitPubspecResolution,
|
||||
}) async {
|
||||
final Directory assetDirectory = fileSystem
|
||||
.directory(assetDirPath)
|
||||
|
||||
@@ -63,6 +63,7 @@ void main() {
|
||||
target: 'main.dart',
|
||||
analytics: fakeAnalytics,
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
}, overrides: <Type, Generator>{
|
||||
Analytics: () => FakeAnalytics(),
|
||||
@@ -114,6 +115,7 @@ void main() {
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: globals.analytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
flutterDevice.generator = residentCompiler;
|
||||
|
||||
@@ -138,6 +140,7 @@ void main() {
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: globals.analytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
flutterDevice.generator = residentCompiler;
|
||||
|
||||
@@ -159,6 +162,7 @@ void main() {
|
||||
debuggingOptions: DebuggingOptions.enabled(BuildInfo.release),
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
flutterDevice.runColdCode = 1;
|
||||
|
||||
@@ -180,6 +184,7 @@ void main() {
|
||||
debuggingOptions: DebuggingOptions.enabled(BuildInfo.release),
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
flutterDevice.runColdError = Exception('BAD STUFF');
|
||||
|
||||
@@ -208,6 +213,7 @@ void main() {
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: globals.analytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
flutterDevice.generator = residentCompiler;
|
||||
|
||||
@@ -268,6 +274,7 @@ void main() {
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: globals.analytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final Completer<DebugConnectionInfo> futureConnectionInfo = Completer<DebugConnectionInfo>.sync();
|
||||
final Completer<void> futureAppStart = Completer<void>.sync();
|
||||
@@ -409,6 +416,7 @@ void main() {
|
||||
enableDevTools: false,
|
||||
),
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final Completer<DebugConnectionInfo> futureConnectionInfo = Completer<DebugConnectionInfo>.sync();
|
||||
final Completer<void> futureAppStart = Completer<void>.sync();
|
||||
@@ -473,6 +481,7 @@ void main() {
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final Completer<DebugConnectionInfo> futureConnectionInfo = Completer<DebugConnectionInfo>.sync();
|
||||
final Completer<void> futureAppStart = Completer<void>.sync();
|
||||
@@ -737,6 +746,7 @@ void main() {
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
devFS.nextUpdateReport = UpdateFSReport(
|
||||
success: true,
|
||||
@@ -1081,6 +1091,7 @@ void main() {
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
expect(otherRunner.artifactDirectory.path, contains('foobar'));
|
||||
}));
|
||||
@@ -1194,6 +1205,7 @@ flutter:
|
||||
target: 'custom_main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
await residentRunner.runSourceGenerators();
|
||||
|
||||
@@ -1254,6 +1266,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
flutterDevice.generator = residentCompiler;
|
||||
|
||||
@@ -1354,6 +1367,7 @@ flutter:
|
||||
debuggingOptions: DebuggingOptions.disabled(BuildInfo.release),
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
residentRunner.printHelp(details: true);
|
||||
|
||||
@@ -1389,6 +1403,7 @@ flutter:
|
||||
debuggingOptions: DebuggingOptions.disabled(BuildInfo.release),
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
residentRunner.printHelp(details: false);
|
||||
|
||||
@@ -1478,6 +1493,7 @@ flutter:
|
||||
debuggingOptions: DebuggingOptions.enabled(BuildInfo.profile, vmserviceOutFile: 'foo', enableDevTools: false),
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
final Future<int?> result = residentRunner.attach();
|
||||
@@ -1523,6 +1539,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
await residentRunner.run();
|
||||
@@ -1553,6 +1570,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
residentRunner.artifactDirectory.childFile('app.dill').writeAsStringSync('ABC');
|
||||
|
||||
@@ -1584,6 +1602,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
residentRunner.artifactDirectory.childFile('app.dill').writeAsStringSync('ABC');
|
||||
|
||||
@@ -1616,6 +1635,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
residentRunner.artifactDirectory.childFile('app.dill').writeAsStringSync('ABC');
|
||||
|
||||
@@ -1640,6 +1660,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
residentRunner.artifactDirectory.childFile('app.dill').writeAsStringSync('ABC');
|
||||
|
||||
@@ -1665,6 +1686,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
residentRunner.artifactDirectory.childFile('app.dill').writeAsStringSync('ABC');
|
||||
|
||||
@@ -1694,6 +1716,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
residentRunner.artifactDirectory.childFile('app.dill').writeAsStringSync('ABC');
|
||||
|
||||
@@ -1717,6 +1740,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
await residentRunner.run();
|
||||
@@ -1738,6 +1762,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
await residentRunner.run();
|
||||
@@ -1761,6 +1786,7 @@ flutter:
|
||||
debuggingOptions: DebuggingOptions.enabled(BuildInfo.profile, vmserviceOutFile: 'foo'),
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
target: 'main.dart',
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
await residentRunner.run();
|
||||
@@ -2142,6 +2168,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
await residentRunner.cleanupAtFinish();
|
||||
|
||||
@@ -2163,6 +2190,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
(flutterDevice.devFS! as FakeDevFS).assetPathsToEvict = <String>{'asset'};
|
||||
@@ -2188,6 +2216,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
(flutterDevice.devFS! as FakeDevFS).shaderPathsToEvict = <String>{'foo.frag'};
|
||||
@@ -2210,6 +2239,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(flutterDevice.devFS!.hasSetAssetDirectory, false);
|
||||
@@ -2232,6 +2262,7 @@ flutter:
|
||||
target: 'main.dart',
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
(flutterDevice.devFS! as FakeDevFS).assetPathsToEvict = <String>{'asset'};
|
||||
@@ -2281,6 +2312,7 @@ flutter:
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
analytics: globals.analytics,
|
||||
nativeAssetsYamlFile: 'foo.yaml',
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
final int? result = await residentRunner.run();
|
||||
|
||||
@@ -61,6 +61,7 @@ void main() {
|
||||
fs: fileSystem,
|
||||
fakeFlutterVersion: FakeFlutterVersion(),
|
||||
),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
final Completer<DebugConnectionInfo> connectionInfoCompleter = Completer<DebugConnectionInfo>();
|
||||
@@ -91,6 +92,7 @@ void main() {
|
||||
fs: fileSystem,
|
||||
fakeFlutterVersion: FakeFlutterVersion(),
|
||||
),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(() => residentWebRunner.run(), throwsToolExit());
|
||||
@@ -116,6 +118,7 @@ void main() {
|
||||
fs: fileSystem,
|
||||
fakeFlutterVersion: FakeFlutterVersion(),
|
||||
),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(() async => residentWebRunner.run(), throwsException);
|
||||
@@ -140,6 +143,7 @@ void main() {
|
||||
fs: fileSystem,
|
||||
fakeFlutterVersion: FakeFlutterVersion(),
|
||||
),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final Completer<DebugConnectionInfo> connectionInfoCompleter = Completer<DebugConnectionInfo>();
|
||||
unawaited(residentWebRunner.run(
|
||||
@@ -169,6 +173,7 @@ void main() {
|
||||
fs: fileSystem,
|
||||
fakeFlutterVersion: FakeFlutterVersion(),
|
||||
),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
final Completer<DebugConnectionInfo> connectionInfoCompleter = Completer<DebugConnectionInfo>();
|
||||
unawaited(residentWebRunner.run(
|
||||
|
||||
@@ -170,6 +170,7 @@ void main() {
|
||||
usage: globals.flutterUsage,
|
||||
analytics: globals.analytics,
|
||||
systemClock: globals.systemClock,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(profileResidentWebRunner.debuggingEnabled, false);
|
||||
@@ -202,6 +203,7 @@ void main() {
|
||||
usage: globals.flutterUsage,
|
||||
analytics: globals.analytics,
|
||||
systemClock: globals.systemClock,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(profileResidentWebRunner.uri, webDevFS.baseUri);
|
||||
@@ -221,6 +223,7 @@ void main() {
|
||||
usage: globals.flutterUsage,
|
||||
analytics: globals.analytics,
|
||||
systemClock: globals.systemClock,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[]);
|
||||
flutterDevice.device = chromeDevice;
|
||||
@@ -234,6 +237,7 @@ void main() {
|
||||
usage: globals.flutterUsage,
|
||||
analytics: globals.analytics,
|
||||
systemClock: globals.systemClock,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(profileResidentWebRunner.supportsServiceProtocol, false);
|
||||
@@ -368,6 +372,7 @@ void main() {
|
||||
analytics: globals.analytics,
|
||||
systemClock: globals.systemClock,
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(await residentWebRunner.run(), 0);
|
||||
@@ -395,6 +400,7 @@ void main() {
|
||||
analytics: globals.analytics,
|
||||
systemClock: globals.systemClock,
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
expect(await residentWebRunner.run(), 0);
|
||||
@@ -596,6 +602,7 @@ void main() {
|
||||
analytics: globals.analytics,
|
||||
systemClock: globals.systemClock,
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
fakeVmServiceHost =
|
||||
FakeVmServiceHost(requests: kAttachExpectations.toList());
|
||||
@@ -1120,6 +1127,7 @@ void main() {
|
||||
analytics: globals.analytics,
|
||||
systemClock: globals.systemClock,
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
final Completer<DebugConnectionInfo> connectionInfoCompleter =
|
||||
@@ -1169,6 +1177,7 @@ void main() {
|
||||
analytics: globals.analytics,
|
||||
systemClock: globals.systemClock,
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
final Completer<DebugConnectionInfo> connectionInfoCompleter =
|
||||
@@ -1212,6 +1221,7 @@ void main() {
|
||||
analytics: globals.analytics,
|
||||
systemClock: globals.systemClock,
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
|
||||
// Create necessary files.
|
||||
@@ -1468,6 +1478,7 @@ ResidentRunner setUpResidentRunner(
|
||||
fileSystem: globals.fs,
|
||||
logger: logger ?? BufferLogger.test(),
|
||||
devtoolsHandler: createNoOpHandler,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,6 +98,7 @@ void main() {
|
||||
artifacts: Artifacts.test(),
|
||||
logger: BufferLogger.test(),
|
||||
flutterVersion: FakeFlutterVersion(),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
logLines = <String>[];
|
||||
device.getLogReader().logLines.listen(logLines.add);
|
||||
@@ -217,6 +218,7 @@ FlutterTesterDevices setUpFlutterTesterDevices() {
|
||||
processManager: FakeProcessManager.any(),
|
||||
fileSystem: MemoryFileSystem.test(),
|
||||
flutterVersion: FakeFlutterVersion(),
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ void main() {
|
||||
flutterVersion: flutterVersion,
|
||||
fileSystem: fileSystem,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
await webBuilder.buildWeb(
|
||||
flutterProject,
|
||||
@@ -160,6 +161,7 @@ void main() {
|
||||
flutterVersion: flutterVersion,
|
||||
fileSystem: fileSystem,
|
||||
analytics: fakeAnalytics,
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
await expectLater(
|
||||
() async => webBuilder.buildWeb(
|
||||
|
||||
@@ -183,7 +183,7 @@ void testUsingContext(
|
||||
// can provide the AlwaysFalseBotDetector in the overrides, or its own
|
||||
// BotDetector implementation in the overrides.
|
||||
BotDetector: overrides[BotDetector] ?? () => const FakeBotDetector(true),
|
||||
});
|
||||
}, useImplicitPubspecResolution: true);
|
||||
}, testOn: testOn, skip: skip);
|
||||
// We don't support "timeout"; see ../../dart_test.yaml which
|
||||
// configures all tests to have a 15 minute timeout which should
|
||||
|
||||
@@ -92,7 +92,7 @@ class Testbed {
|
||||
///
|
||||
/// `overrides` may be used to provide new context values for the single test
|
||||
/// case or override any context values from the setup.
|
||||
Future<T?> run<T>(FutureOr<T> Function() test, {Map<Type, Generator>? overrides}) {
|
||||
Future<T?> run<T>(FutureOr<T> Function() test, {Map<Type, Generator>? overrides, bool useImplicitPubspecResolution = true}) {
|
||||
final Map<Type, Generator> testOverrides = <Type, Generator>{
|
||||
..._testbedDefaults,
|
||||
// Add the initial setUp overrides
|
||||
@@ -139,7 +139,7 @@ class Testbed {
|
||||
}
|
||||
return null;
|
||||
});
|
||||
});
|
||||
}, useImplicitPubspecResolution: useImplicitPubspecResolution);
|
||||
}, createHttpClient: (SecurityContext? c) => FakeHttpClient.any());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ void main() {
|
||||
processManager: FakeProcessManager.empty(),
|
||||
),
|
||||
dartSdkPath: 'dart',
|
||||
useImplicitPubspecResolution: true,
|
||||
);
|
||||
const String link = 'https://flutter.dev/to/integration-test-on-web';
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user