have android_semantics_testing use adb from ENV provided android sdk (#37828)
This commit is contained in:
committed by
GitHub
parent
2adb042cb8
commit
771c843f56
@@ -10,6 +10,16 @@ import 'package:android_semantics_testing/android_semantics_testing.dart';
|
||||
|
||||
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
||||
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() {
|
||||
group('AccessibilityBridge', () {
|
||||
@@ -23,7 +33,7 @@ void main() {
|
||||
setUpAll(() async {
|
||||
driver = await FlutterDriver.connect();
|
||||
// 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',
|
||||
'settings',
|
||||
'put',
|
||||
@@ -36,7 +46,7 @@ void main() {
|
||||
|
||||
tearDownAll(() async {
|
||||
// ... 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',
|
||||
'settings',
|
||||
'put',
|
||||
|
||||
Reference in New Issue
Block a user