Memory test on scrolling large images quickly (#46184)
This commit is contained in:
committed by
Flutter GitHub Bot
parent
42cb9190b2
commit
a2005eaf9a
@@ -0,0 +1,41 @@
|
||||
// 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/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
const String kPackageName = 'com.example.macrobenchmarks';
|
||||
const String kActivityName = 'com.example.macrobenchmarks.MainActivity';
|
||||
|
||||
class FastScrollLargeImagesMemoryTest extends MemoryTest {
|
||||
FastScrollLargeImagesMemoryTest()
|
||||
: super(
|
||||
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
|
||||
'test_memory/large_images.dart', kPackageName,
|
||||
);
|
||||
|
||||
@override
|
||||
AndroidDevice get device => super.device;
|
||||
|
||||
@override
|
||||
int get iterationCount => 5;
|
||||
|
||||
@override
|
||||
Future<void> useMemory() async {
|
||||
await launchApp();
|
||||
await recordStart();
|
||||
await device.shellExec('input', <String>['swipe', '0 1500 0 0 50']);
|
||||
await Future<void>.delayed(const Duration(milliseconds: 10000));
|
||||
await recordEnd();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(FastScrollLargeImagesMemoryTest().run);
|
||||
}
|
||||
@@ -670,6 +670,12 @@ tasks:
|
||||
stage: devicelab
|
||||
required_agent_capabilities: ["linux/android"]
|
||||
|
||||
fast_scroll_large_images__memory:
|
||||
description: >
|
||||
Measures memory usage for scrolling through a list of large images.
|
||||
stage: devicelab
|
||||
required_agent_capabilities: ["mac/android"]
|
||||
|
||||
analyzer_benchmark:
|
||||
description: >
|
||||
Measures the speed of Dart analyzer.
|
||||
|
||||
Reference in New Issue
Block a user