Place existing dill into hot reload temp directory to boost initialization time (#40366)

This commit is contained in:
Jonah Williams
2019-09-12 12:45:53 -07:00
committed by GitHub
parent a6138bb005
commit 1fec30efb6
2 changed files with 17 additions and 0 deletions

View File

@@ -35,6 +35,9 @@ void main() {
setUp(() {
testbed = Testbed(setup: () {
fs.file(fs.path.join('build', 'app.dill'))
..createSync(recursive: true)
..writeAsStringSync('ABC');
residentRunner = HotRunner(
<FlutterDevice>[
mockFlutterDevice,
@@ -193,6 +196,10 @@ void main() {
Usage: () => MockUsage(),
}));
test('ResidentRunner copies dill file from build output into temp directory', () => testbed.run(() async {
expect(residentRunner.artifactDirectory.childFile('app.dill').readAsStringSync(), 'ABC');
}));
test('ResidentRunner can send target platform to analytics from hot reload', () => testbed.run(() async {
when(mockDevice.sdkNameAndVersion).thenAnswer((Invocation invocation) async {
return 'Example';