Clean up flutter_gallery__transition_perf (#63609)

This commit is contained in:
Ming Lyu (CareF)
2020-08-13 17:41:04 -04:00
committed by GitHub
parent 8f896c9027
commit 360023e2bc
9 changed files with 181 additions and 97 deletions

View File

@@ -0,0 +1,14 @@
// 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:async';
import 'package:flutter_devicelab/tasks/gallery.dart';
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android;
await task(createGalleryTransitionHybridTest());
}

View File

@@ -11,14 +11,15 @@ import '../framework/adb.dart';
import '../framework/framework.dart';
import '../framework/utils.dart';
TaskFunction createGalleryTransitionTest({ bool semanticsEnabled = false }) {
TaskFunction createGalleryTransitionTest({bool semanticsEnabled = false}) {
return GalleryTransitionTest(semanticsEnabled: semanticsEnabled);
}
TaskFunction createGalleryTransitionE2ETest({ bool semanticsEnabled = false }) {
TaskFunction createGalleryTransitionE2ETest({bool semanticsEnabled = false}) {
return GalleryTransitionTest(
semanticsEnabled: semanticsEnabled,
testFile: 'transitions_perf_e2e',
testFile: semanticsEnabled
? 'transitions_perf_e2e_with_semantics'
: 'transitions_perf_e2e',
needFullTimeline: false,
timelineSummaryFile: 'e2e_perf_summary',
transitionDurationFile: null,
@@ -26,6 +27,15 @@ TaskFunction createGalleryTransitionE2ETest({ bool semanticsEnabled = false }) {
);
}
TaskFunction createGalleryTransitionHybridTest({bool semanticsEnabled = false}) {
return GalleryTransitionTest(
semanticsEnabled: semanticsEnabled,
driverFile: semanticsEnabled
? 'transitions_perf_hybrid_with_semantics_test'
: 'transitions_perf_hybrid_test',
);
}
class GalleryTransitionTest {
GalleryTransitionTest({
@@ -53,18 +63,18 @@ class GalleryTransitionTest {
await inDirectory<void>(galleryDirectory, () async {
await flutter('packages', options: <String>['get']);
final String testDriver = semanticsEnabled
? '${testFile}_with_semantics.dart'
: '$testFile.dart';
final String testDriver = driverFile ?? (semanticsEnabled
? '${testFile}_test'
: '${testFile}_with_semantics_test');
await flutter('drive', options: <String>[
'--profile',
if (needFullTimeline)
'--trace-startup',
'-t',
'test_driver/$testDriver',
if (driverFile != null)
...<String>['--driver', 'test_driver/$driverFile.dart'],
'test_driver/$testFile.dart',
'--driver',
'test_driver/$testDriver.dart',
'-d',
deviceId,
]);

View File

@@ -769,6 +769,16 @@ tasks:
required_agent_capabilities: ["linux/android"]
flaky: true
flutter_gallery__transition_perf_hybrid:
description: >
Measures the performance of screen transitions in Flutter Gallery on
Android where the page transitions are self-driven on device without host
interventions, but the timeline events are still sent to host to be
processed.
stage: devicelab
required_agent_capabilities: ["linux/android"]
flaky: true
flutter_gallery_sksl_warmup__transition_perf:
description: >
Measures the runtime performance of Flutter gallery transitions on Android