migrate hot reload benchmark to the new devicelab framework (#5878)
This commit is contained in:
parent
2a81391915
commit
921287b412
32
dev/devicelab/bin/tasks/hot_mode_dev_cycle__benchmark.dart
Normal file
32
dev/devicelab/bin/tasks/hot_mode_dev_cycle__benchmark.dart
Normal file
@ -0,0 +1,32 @@
|
||||
// Copyright (c) 2016 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:io';
|
||||
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
|
||||
void main() {
|
||||
task(() async {
|
||||
Adb device = await adb();
|
||||
await device.unlock();
|
||||
Directory appDir =
|
||||
dir(path.join(flutterDirectory.path, 'examples/flutter_gallery'));
|
||||
File benchmarkFile = file(path.join(appDir.path, 'hot_benchmark.json'));
|
||||
rm(benchmarkFile);
|
||||
await inDirectory(appDir, () async {
|
||||
return await flutter('run',
|
||||
options: <String>['--hot', '-d', device.deviceId, '--benchmark'],
|
||||
canFail: false);
|
||||
});
|
||||
return new TaskResult.successFromFile(benchmarkFile,
|
||||
benchmarkScoreKeys: <String>[
|
||||
'hotReloadMillisecondsToFrame',
|
||||
'hotRestartMillisecondsToFrame'
|
||||
]);
|
||||
});
|
||||
}
|
@ -103,6 +103,12 @@ tasks:
|
||||
stage: devicelab
|
||||
required_agent_capabilities: ["has-android-device"]
|
||||
|
||||
hot_mode_dev_cycle__benchmark:
|
||||
description: >
|
||||
Measures the performance of Dart VM hot patching feature.
|
||||
stage: devicelab
|
||||
required_agent_capabilities: ["has-android-device"]
|
||||
|
||||
|
||||
# iOS on-device tests
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user