From 832c0f1f0330418f4f08bf868d5b359745d9be0e Mon Sep 17 00:00:00 2001 From: Yegor Date: Wed, 12 Jul 2017 12:37:22 -0700 Subject: [PATCH] unlock device and pass JAVA_HOME to instrumentation test (#11174) --- .../tasks/flutter_gallery_instrumentation_test.dart | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dev/devicelab/bin/tasks/flutter_gallery_instrumentation_test.dart b/dev/devicelab/bin/tasks/flutter_gallery_instrumentation_test.dart index 4ae7cfa499..81670e6a94 100644 --- a/dev/devicelab/bin/tasks/flutter_gallery_instrumentation_test.dart +++ b/dev/devicelab/bin/tasks/flutter_gallery_instrumentation_test.dart @@ -16,9 +16,15 @@ Future main() async { final Directory galleryDirectory = dir('${flutterDirectory.path}/examples/flutter_gallery'); await inDirectory(galleryDirectory, () async { + final Device device = await devices.workingDevice; + await device.unlock(); await flutter('packages', options: ['get']); - await flutter('build', options: ['clean']); // to reset the Dart entry point - await exec('tool/run_instrumentation_test.sh', []); + await flutter('build', options: ['clean']); + await flutter('build', options: ['apk', '--target', 'test/live_smoketest.dart']); + final String androidStudioPath = grep('Android Studio at', from: await evalFlutter('doctor')).first.split(' ').last; + await exec('./tool/run_instrumentation_test.sh', [], environment: { + 'JAVA_HOME': '$androidStudioPath/jre', + }); }); return new TaskResult.success(null);