Revert "It's time to #deleteDart1 (#18293)" (#18313)

Several benchmarks started failing during kernel compile:
1. Timeouts:
   * commands_test
   * hot_mode_dev_cycle__benchmark
   * run_machine_concurrent_hot_reload
   * service_extensions_test

2. Kernel compiler crash:
   * hot_mode_dev_cycle_linux__benchmark
   * routing_test

3. Unexpected termination:
   * hot_mode_dev_cycle_win__benchmark

This reverts commit ed63e7082a.
This commit is contained in:
Chris Bracken
2018-06-08 12:43:11 -07:00
committed by GitHub
parent ed63e7082a
commit 9495df4bc3
45 changed files with 873 additions and 220 deletions

View File

@@ -6,14 +6,11 @@ import 'dart:async';
import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/compile.dart';
import 'package:flutter_tools/src/device.dart';
import 'package:flutter_tools/src/tester/flutter_tester.dart';
import 'package:mockito/mockito.dart';
import 'package:process/process.dart';
import 'package:test/test.dart';
@@ -100,8 +97,6 @@ void main() {
String projectPath;
String mainPath;
MockArtifacts mockArtifacts;
MockKernelCompiler mockKernelCompiler;
MockProcessManager mockProcessManager;
MockProcess mockProcess;
@@ -110,8 +105,6 @@ void main() {
FileSystem: () => fs,
Cache: () => new Cache(rootOverride: fs.directory(flutterRoot)),
ProcessManager: () => mockProcessManager,
KernelCompiler: () => mockKernelCompiler,
Artifacts: () => mockArtifacts,
};
setUp(() {
@@ -129,13 +122,6 @@ void main() {
mockProcessManager = new MockProcessManager();
mockProcessManager.processFactory =
(List<String> commands) => mockProcess;
mockArtifacts = new MockArtifacts();
final String artifactPath = fs.path.join(flutterRoot, 'artifact');
fs.file(artifactPath).createSync(recursive: true);
when(mockArtifacts.getArtifactPath(any)).thenReturn(artifactPath);
mockKernelCompiler = new MockKernelCompiler();
});
testUsingContext('not debug', () async {
@@ -167,22 +153,6 @@ Hello!
.codeUnits
]));
when(mockKernelCompiler.compile(
sdkRoot: any,
incrementalCompilerByteStorePath: any,
mainPath: any,
outputFilePath: any,
depFilePath: any,
trackWidgetCreation: any,
extraFrontEndOptions: any,
fileSystemRoots: any,
fileSystemScheme: any,
packagesPath: any,
)).thenAnswer((_) async {
fs.file('$mainPath.dill').createSync(recursive: true);
return new CompilerOutput('$mainPath.dill', 0);
});
final LaunchResult result = await device.startApp(null,
mainPath: mainPath,
debuggingOptions: new DebuggingOptions.enabled(
@@ -195,6 +165,3 @@ Hello!
});
});
}
class MockArtifacts extends Mock implements Artifacts {}
class MockKernelCompiler extends Mock implements KernelCompiler {}