Unverified Commit 03db9bf9 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[devicelab] migrate defines test to DriverTest (#68407)

Removes one-off handling for defines test and forces it to run through the DriverTest interface
parent 223df0c3
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
import 'package:flutter_devicelab/framework/adb.dart'; import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart'; import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/tasks/defines_task.dart'; import 'package:flutter_devicelab/tasks/integration_tests.dart';
/// Verify that dart defines work on Android. /// Verify that dart defines work on Android.
Future<void> main() async { Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android; deviceOperatingSystem = DeviceOperatingSystem.android;
await task(runDartDefinesTask); await task(dartDefinesTask());
} }
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
import 'package:flutter_devicelab/framework/adb.dart'; import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart'; import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/tasks/defines_task.dart'; import 'package:flutter_devicelab/tasks/integration_tests.dart';
/// Verify that dart defines work on iOS. /// Verify that dart defines work on iOS.
Future<void> main() async { Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios; deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(runDartDefinesTask); await task(dartDefinesTask());
} }
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io';
import '../framework/adb.dart';
import '../framework/task_result.dart';
import '../framework/utils.dart';
Future<TaskResult> runDartDefinesTask() async {
final Device device = await devices.workingDevice;
await device.unlock();
final String deviceId = device.deviceId;
final Directory testDirectory = dir('${flutterDirectory.path}/dev/integration_tests/ui');
await inDirectory<void>(testDirectory, () async {
await flutter('packages', options: <String>['get']);
await flutter('drive', options: <String>[
'--no-android-gradle-daemon',
'--verbose',
'-d',
deviceId,
'--dart-define=test.valueA=Example',
'--dart-define=test.valueB=Value',
'lib/defines.dart',
]);
});
return TaskResult.success(<String, dynamic>{});
}
...@@ -127,6 +127,16 @@ TaskFunction createEndToEndKeyboardTextfieldTest() { ...@@ -127,6 +127,16 @@ TaskFunction createEndToEndKeyboardTextfieldTest() {
); );
} }
TaskFunction dartDefinesTask() {
return DriverTest(
'${flutterDirectory.path}/dev/integration_tests/ui',
'lib/defines.dart', extraOptions: <String>[
'--dart-define=test.valueA=Example',
'--dart-define=test.valueB=Value',
],
);
}
class DriverTest { class DriverTest {
DriverTest( DriverTest(
this.testDirectory, this.testDirectory,
......
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