Unverified Commit 771c843f authored by Christopher Fujino's avatar Christopher Fujino Committed by GitHub

have android_semantics_testing use adb from ENV provided android sdk (#37828)

parent 2adb042c
...@@ -10,6 +10,16 @@ import 'package:android_semantics_testing/android_semantics_testing.dart'; ...@@ -10,6 +10,16 @@ import 'package:android_semantics_testing/android_semantics_testing.dart';
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf; import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
import 'package:flutter_driver/flutter_driver.dart'; import 'package:flutter_driver/flutter_driver.dart';
import 'package:path/path.dart' as path;
String adbPath() {
final String androidHome = io.Platform.environment['ANDROID_HOME'] ?? io.Platform.environment['ANDROID_SDK_ROOT'];
if (androidHome == null) {
return 'adb';
} else {
return path.join(androidHome, 'platform-tools', 'adb');
}
}
void main() { void main() {
group('AccessibilityBridge', () { group('AccessibilityBridge', () {
...@@ -23,7 +33,7 @@ void main() { ...@@ -23,7 +33,7 @@ void main() {
setUpAll(() async { setUpAll(() async {
driver = await FlutterDriver.connect(); driver = await FlutterDriver.connect();
// Say the magic words.. // Say the magic words..
final io.Process run = await io.Process.start('adb', const <String>[ final io.Process run = await io.Process.start(adbPath(), const <String>[
'shell', 'shell',
'settings', 'settings',
'put', 'put',
...@@ -36,7 +46,7 @@ void main() { ...@@ -36,7 +46,7 @@ void main() {
tearDownAll(() async { tearDownAll(() async {
// ... And turn it off again // ... And turn it off again
final io.Process run = await io.Process.start('adb', const <String>[ final io.Process run = await io.Process.start(adbPath(), const <String>[
'shell', 'shell',
'settings', 'settings',
'put', 'put',
......
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