Add integration test for the Platform Services app (#8826)
This commit is contained in:
@@ -9,6 +9,14 @@ import '../framework/adb.dart';
|
||||
import '../framework/framework.dart';
|
||||
import '../framework/utils.dart';
|
||||
|
||||
|
||||
TaskFunction createPlatformServiceDriverTest() {
|
||||
return new DriverTest(
|
||||
'${flutterDirectory.path}/examples/platform_services',
|
||||
'test_driver/button_tap.dart',
|
||||
);
|
||||
}
|
||||
|
||||
TaskFunction createComplexLayoutScrollPerfTest() {
|
||||
return new PerfTest(
|
||||
'${flutterDirectory.path}/dev/benchmarks/complex_layout',
|
||||
@@ -152,6 +160,39 @@ class PerfTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class DriverTest {
|
||||
|
||||
DriverTest(this.testDirectory, this.testTarget);
|
||||
|
||||
final String testDirectory;
|
||||
final String testTarget;
|
||||
|
||||
Future<TaskResult> call() {
|
||||
return inDirectory(testDirectory, () async {
|
||||
final Device device = await devices.workingDevice;
|
||||
await device.unlock();
|
||||
final String deviceId = device.deviceId;
|
||||
await flutter('packages', options: <String>['get']);
|
||||
|
||||
if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
|
||||
// This causes an Xcode project to be created.
|
||||
await flutter('build', options: <String>['ios', '--profile']);
|
||||
}
|
||||
|
||||
await flutter('drive', options: <String>[
|
||||
'-v',
|
||||
'-t',
|
||||
testTarget,
|
||||
'-d',
|
||||
deviceId,
|
||||
]);
|
||||
|
||||
return new TaskResult.success(null);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class BuildTest {
|
||||
|
||||
BuildTest(this.testDirectory);
|
||||
|
||||
Reference in New Issue
Block a user