Commit 7f9d859e authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Pass package/activity in AndroidBackButtonMemoryTest (#9738)

Eliminates Gallery-specific hardcoding of app package and activity name
in the test.

Fixes breakage introduced with 1dc2d4eb
due to main activity class now being MainActivity.
parent 1dc2d4eb
......@@ -65,6 +65,7 @@ TaskFunction createGalleryBackButtonMemoryTest() {
return new AndroidBackButtonMemoryTest(
'${flutterDirectory.path}/examples/flutter_gallery',
'io.flutter.examples.gallery',
'io.flutter.examples.gallery.MainActivity',
);
}
......@@ -300,8 +301,9 @@ class MemoryTest {
class AndroidBackButtonMemoryTest {
final String testDirectory;
final String packageName;
final String activityName;
AndroidBackButtonMemoryTest(this.testDirectory, this.packageName);
AndroidBackButtonMemoryTest(this.testDirectory, this.packageName, this.activityName);
Future<TaskResult> call() {
return inDirectory(testDirectory, () async {
......@@ -332,7 +334,7 @@ class AndroidBackButtonMemoryTest {
for (int i = 0; i < 10; i++) {
await device.shellExec('input', <String>['keyevent', 'KEYCODE_BACK']);
await new Future<Null>.delayed(const Duration(milliseconds: 1000));
final String output = await device.shellEval('am', <String>['start', '-n', 'io.flutter.examples.gallery/io.flutter.app.FlutterActivity']);
final String output = await device.shellEval('am', <String>['start', '-n', '$packageName/$activityName']);
print(output);
if (output.contains('Error'))
return new TaskResult.failure('unable to launch activity');
......
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