File tree 4 files changed +74
-0
lines changed
4 files changed +74
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Flutter Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import 'dart:async' ;
6
+ import 'dart:io' ;
7
+
8
+ import 'package:flutter_devicelab/framework/utils.dart' ;
9
+ import 'package:flutter_devicelab/tasks/new_gallery.dart' ;
10
+ import 'package:flutter_devicelab/framework/adb.dart' ;
11
+ import 'package:flutter_devicelab/framework/framework.dart' ;
12
+ import 'package:path/path.dart' as path;
13
+
14
+ Future <void > main () async {
15
+ deviceOperatingSystem = DeviceOperatingSystem .android;
16
+
17
+ final Directory galleryParentDir = Directory .systemTemp.createTempSync ('new_gallery_test' );
18
+ final Directory galleryDir = Directory (path.join (galleryParentDir.path, 'gallery' ));
19
+
20
+ try {
21
+ await task (NewGalleryPerfTest (galleryDir).run);
22
+ } finally {
23
+ rmTree (galleryParentDir);
24
+ }
25
+ }
Original file line number Diff line number Diff line change @@ -501,6 +501,22 @@ String jsonEncode(dynamic data) {
501
501
return const JsonEncoder .withIndent (' ' ).convert (data) + '\n ' ;
502
502
}
503
503
504
+ Future <void > getNewGallery (String revision, Directory galleryDir) async {
505
+ section ('Get New Flutter Gallery!' );
506
+
507
+ if (exists (galleryDir)) {
508
+ galleryDir.deleteSync (recursive: true );
509
+ }
510
+
511
+ await inDirectory <void >(galleryDir.parent, () async {
512
+ await exec ('git' , < String > ['clone' , 'https://github.com/flutter/gallery.git' ]);
513
+ });
514
+
515
+ await inDirectory <void >(galleryDir, () async {
516
+ await exec ('git' , < String > ['checkout' , revision]);
517
+ });
518
+ }
519
+
504
520
void checkNotNull (Object o1,
505
521
[Object o2 = 1 ,
506
522
Object o3 = 1 ,
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Flutter Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import 'dart:async' ;
6
+ import 'dart:io' ;
7
+
8
+ import 'package:flutter_devicelab/tasks/perf_tests.dart' ;
9
+
10
+
11
+ import '../framework/framework.dart' ;
12
+ import '../framework/utils.dart' ;
13
+
14
+ class NewGalleryPerfTest extends PerfTest {
15
+ NewGalleryPerfTest (this .galleryDir) : super (galleryDir.path, 'test_driver/transitions_perf.dart' , 'transitions' );
16
+
17
+ @override
18
+ Future <TaskResult > run () async {
19
+ // Manually roll the new gallery version for now. If the new gallery repo
20
+ // turns out to be updated frequently in the future, we can set up an auto
21
+ // roller to update this version.
22
+ await getNewGallery ('59489e5571ddf554fc62ef52e9b16f1fed291026' , galleryDir);
23
+ return await super .run ();
24
+ }
25
+
26
+ final Directory galleryDir;
27
+ }
Original file line number Diff line number Diff line change @@ -749,6 +749,12 @@ tasks:
749
749
stage : devicelab
750
750
required_agent_capabilities : ["linux/android"]
751
751
752
+ new_gallery__transition_perf :
753
+ description : >
754
+ Measures the performance of screen transitions in the new Flutter Gallery on Android.
755
+ stage : devicelab
756
+ required_agent_capabilities : ["mac/android"]
757
+
752
758
fast_scroll_large_images__memory :
753
759
description : >
754
760
Measures memory usage for scrolling through a list of large images.
You can’t perform that action at this time.
0 commit comments