Integration test for channel communication (#9621)
This commit is contained in:
committed by
GitHub
parent
0770c3c14f
commit
70ff50f929
@@ -4,11 +4,11 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createPlatformServiceDriverTest());
|
||||
await task(createChannelsIntegrationTest());
|
||||
}
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createPlatformServiceDriverTest());
|
||||
await task(createChannelsIntegrationTest());
|
||||
}
|
||||
14
dev/devicelab/bin/tasks/channels_integration_test_win.dart
Normal file
14
dev/devicelab/bin/tasks/channels_integration_test_win.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
// Copyright 2017 The Chromium 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:async';
|
||||
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createChannelsIntegrationTest());
|
||||
}
|
||||
14
dev/devicelab/bin/tasks/platform_channel_sample_test.dart
Normal file
14
dev/devicelab/bin/tasks/platform_channel_sample_test.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
// Copyright 2017 The Chromium 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:async';
|
||||
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createPlatformChannelSampleTest());
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright 2017 The Chromium 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:async';
|
||||
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createPlatformChannelSampleTest());
|
||||
}
|
||||
57
dev/devicelab/lib/tasks/integration_tests.dart
Normal file
57
dev/devicelab/lib/tasks/integration_tests.dart
Normal file
@@ -0,0 +1,57 @@
|
||||
// Copyright (c) 2017 The Chromium 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:async';
|
||||
|
||||
import '../framework/adb.dart';
|
||||
import '../framework/framework.dart';
|
||||
import '../framework/ios.dart';
|
||||
import '../framework/utils.dart';
|
||||
|
||||
TaskFunction createChannelsIntegrationTest() {
|
||||
return new DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/channels',
|
||||
'lib/main.dart',
|
||||
);
|
||||
}
|
||||
|
||||
TaskFunction createPlatformChannelSampleTest() {
|
||||
return new DriverTest(
|
||||
'${flutterDirectory.path}/examples/platform_channel',
|
||||
'test_driver/button_tap.dart',
|
||||
);
|
||||
}
|
||||
|
||||
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) {
|
||||
await prepareProvisioningCertificates(testDirectory);
|
||||
// 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);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -10,14 +10,6 @@ import '../framework/framework.dart';
|
||||
import '../framework/ios.dart';
|
||||
import '../framework/utils.dart';
|
||||
|
||||
|
||||
TaskFunction createPlatformServiceDriverTest() {
|
||||
return new DriverTest(
|
||||
'${flutterDirectory.path}/examples/platform_channel',
|
||||
'test_driver/button_tap.dart',
|
||||
);
|
||||
}
|
||||
|
||||
TaskFunction createComplexLayoutScrollPerfTest() {
|
||||
return new PerfTest(
|
||||
'${flutterDirectory.path}/dev/benchmarks/complex_layout',
|
||||
@@ -175,40 +167,6 @@ 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) {
|
||||
await prepareProvisioningCertificates(testDirectory);
|
||||
// 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);
|
||||
|
||||
@@ -83,7 +83,13 @@ tasks:
|
||||
required_agent_capabilities: ["has-android-device"]
|
||||
flaky: true
|
||||
|
||||
platform_channel_test:
|
||||
channels_integration_test:
|
||||
description: >
|
||||
Checks that platform channels work on Android.
|
||||
stage: devicelab
|
||||
required_agent_capabilities: ["has-android-device"]
|
||||
|
||||
platform_channel_sample_test:
|
||||
description: >
|
||||
Runs a driver test on the Platform Channel sample app on Android.
|
||||
stage: devicelab
|
||||
@@ -154,7 +160,13 @@ tasks:
|
||||
|
||||
# iOS on-device tests
|
||||
|
||||
platform_channel_test_ios:
|
||||
channels_integration_test_ios:
|
||||
description: >
|
||||
Checks that platform channels work on iOS.
|
||||
stage: devicelab_ios
|
||||
required_agent_capabilities: ["has-ios-device"]
|
||||
|
||||
platform_channel_sample_test_ios:
|
||||
description: >
|
||||
Runs a driver test on the Platform Channel sample app on iOS.
|
||||
stage: devicelab_ios
|
||||
@@ -207,6 +219,13 @@ tasks:
|
||||
|
||||
# Tests running on Windows host
|
||||
|
||||
channels_integration_test_win:
|
||||
description: >
|
||||
Checks that platform channels work when app is launched from Windows.
|
||||
stage: devicelab_win
|
||||
required_agent_capabilities: ["windows"]
|
||||
flaky: true
|
||||
|
||||
flutter_gallery_win__build:
|
||||
description: >
|
||||
Collects various performance metrics from AOT builds of the Flutter
|
||||
|
||||
Reference in New Issue
Block a user