Eliminate Dart 1 support from FlutterDevice class (#21402)
This commit is contained in:
@@ -119,7 +119,6 @@ class AttachCommand extends FlutterCommand {
|
||||
final FlutterDevice flutterDevice = new FlutterDevice(
|
||||
device,
|
||||
trackWidgetCreation: false,
|
||||
previewDart2: true,
|
||||
dillOutputPath: argResults['output-dill'],
|
||||
fileSystemRoots: argResults['filesystem-root'],
|
||||
fileSystemScheme: argResults['filesystem-scheme'],
|
||||
|
||||
@@ -344,7 +344,6 @@ class AppDomain extends Domain {
|
||||
|
||||
final FlutterDevice flutterDevice = new FlutterDevice(
|
||||
device,
|
||||
previewDart2: true,
|
||||
trackWidgetCreation: trackWidgetCreation,
|
||||
dillOutputPath: dillOutputPath,
|
||||
);
|
||||
|
||||
@@ -133,7 +133,6 @@ class FuchsiaReloadCommand extends FlutterCommand {
|
||||
final FlutterDevice flutterDevice = new FlutterDevice(
|
||||
device,
|
||||
trackWidgetCreation: false,
|
||||
previewDart2: true,
|
||||
);
|
||||
flutterDevice.observatoryUris = observatoryUris;
|
||||
final HotRunner hotRunner = new HotRunner(
|
||||
|
||||
@@ -339,7 +339,6 @@ class RunCommand extends RunCommandBase {
|
||||
final List<FlutterDevice> flutterDevices = devices.map((Device device) {
|
||||
return new FlutterDevice(
|
||||
device,
|
||||
previewDart2: true,
|
||||
trackWidgetCreation: argResults['track-widget-creation'],
|
||||
dillOutputPath: argResults['output-dill'],
|
||||
fileSystemRoots: argResults['filesystem-root'],
|
||||
|
||||
@@ -42,20 +42,17 @@ class FlutterDevice {
|
||||
StreamSubscription<String> _loggingSubscription;
|
||||
|
||||
FlutterDevice(this.device, {
|
||||
@required bool previewDart2,
|
||||
@required bool trackWidgetCreation,
|
||||
this.dillOutputPath,
|
||||
this.fileSystemRoots,
|
||||
this.fileSystemScheme,
|
||||
ResidentCompiler generator,
|
||||
}) {
|
||||
if (previewDart2) {
|
||||
this.generator = generator ?? new ResidentCompiler(
|
||||
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath),
|
||||
trackWidgetCreation: trackWidgetCreation,
|
||||
fileSystemRoots: fileSystemRoots, fileSystemScheme: fileSystemScheme
|
||||
);
|
||||
}
|
||||
this.generator = generator ?? new ResidentCompiler(
|
||||
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath),
|
||||
trackWidgetCreation: trackWidgetCreation,
|
||||
fileSystemRoots: fileSystemRoots, fileSystemScheme: fileSystemScheme
|
||||
);
|
||||
}
|
||||
|
||||
String viewFilter;
|
||||
|
||||
@@ -102,14 +102,14 @@ void main() {
|
||||
});
|
||||
|
||||
testUsingContext('no setup', () async {
|
||||
final List<FlutterDevice> devices = <FlutterDevice>[new FlutterDevice(new MockDevice(), generator: residentCompiler, trackWidgetCreation: false, previewDart2: true)];
|
||||
final List<FlutterDevice> devices = <FlutterDevice>[new FlutterDevice(new MockDevice(), generator: residentCompiler, trackWidgetCreation: false)];
|
||||
expect((await new HotRunner(devices).restart(fullRestart: true)).isOk, true);
|
||||
}, overrides: <Type, Generator>{
|
||||
Artifacts: () => mockArtifacts,
|
||||
});
|
||||
|
||||
testUsingContext('setup function succeeds', () async {
|
||||
final List<FlutterDevice> devices = <FlutterDevice>[new FlutterDevice(new MockDevice(), generator: residentCompiler, trackWidgetCreation: false, previewDart2: true)];
|
||||
final List<FlutterDevice> devices = <FlutterDevice>[new FlutterDevice(new MockDevice(), generator: residentCompiler, trackWidgetCreation: false)];
|
||||
expect((await new HotRunner(devices).restart(fullRestart: true)).isOk, true);
|
||||
}, overrides: <Type, Generator>{
|
||||
Artifacts: () => mockArtifacts,
|
||||
@@ -117,7 +117,7 @@ void main() {
|
||||
});
|
||||
|
||||
testUsingContext('setup function fails', () async {
|
||||
final List<FlutterDevice> devices = <FlutterDevice>[new FlutterDevice(new MockDevice(), generator: residentCompiler, trackWidgetCreation: false, previewDart2: true)];
|
||||
final List<FlutterDevice> devices = <FlutterDevice>[new FlutterDevice(new MockDevice(), generator: residentCompiler, trackWidgetCreation: false)];
|
||||
expect((await new HotRunner(devices).restart(fullRestart: true)).isOk, false);
|
||||
}, overrides: <Type, Generator>{
|
||||
Artifacts: () => mockArtifacts,
|
||||
|
||||
@@ -47,11 +47,7 @@ void main() {
|
||||
// TODO(jacobr): make these tests run with `trackWidgetCreation: true` as
|
||||
// well as the default flags.
|
||||
return new TestRunner(
|
||||
<FlutterDevice>[new FlutterDevice(
|
||||
new MockDevice(),
|
||||
previewDart2: true,
|
||||
trackWidgetCreation: false,
|
||||
)],
|
||||
<FlutterDevice>[new FlutterDevice(new MockDevice(), trackWidgetCreation: false)],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user