Unverified Commit 70eefd1e authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Eliminate Dart 1 support from FlutterDevice class (#21402)

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