Commit 7da3ab63 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Devicelab memory usage test that navigates repeatedly to a screen within Gallery (#7137)

parent 7034a03c
// Copyright 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:async';
import 'package:flutter_devicelab/tasks/perf_tests.dart';
import 'package:flutter_devicelab/framework/framework.dart';
Future<Null> main() async {
await task(createGalleryNavigationMemoryTest());
}
...@@ -52,6 +52,14 @@ TaskFunction createHelloWorldMemoryTest() { ...@@ -52,6 +52,14 @@ TaskFunction createHelloWorldMemoryTest() {
); );
} }
TaskFunction createGalleryNavigationMemoryTest() {
return new MemoryTest(
'${flutterDirectory.path}/examples/flutter_gallery',
'io.flutter.examples.gallery',
testTarget: 'test_driver/memory_nav.dart',
);
}
/// Measure application startup performance. /// Measure application startup performance.
class StartupTest { class StartupTest {
static const Duration _startupTimeout = const Duration(minutes: 2); static const Duration _startupTimeout = const Duration(minutes: 2);
......
...@@ -121,6 +121,12 @@ tasks: ...@@ -121,6 +121,12 @@ tasks:
stage: devicelab stage: devicelab
required_agent_capabilities: ["has-android-device"] required_agent_capabilities: ["has-android-device"]
flutter_gallery__memory_nav:
description: >
Measures memory usage after repeated navigation in Gallery.
stage: devicelab
required_agent_capabilities: ["has-android-device"]
# iOS on-device tests # iOS on-device tests
......
// Copyright 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 'package:flutter_driver/driver_extension.dart';
import 'package:flutter_gallery/main.dart' as app;
void main() {
enableFlutterDriverExtension();
app.main();
}
import 'dart:async';
import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart';
void main() {
group('flutter gallery transitions', () {
FlutterDriver driver;
setUpAll(() async {
driver = await FlutterDriver.connect();
});
tearDownAll(() async {
if (driver != null)
await driver.close();
});
test('navigation', () async {
SerializableFinder menuItem = find.text('Text fields');
await driver.scrollIntoView(menuItem);
await new Future<Null>.delayed(new Duration(milliseconds: 500));
for (int i = 0; i < 15; i++) {
await driver.tap(menuItem);
await new Future<Null>.delayed(new Duration(milliseconds: 1000));
await driver.tap(find.byTooltip('Back'));
await new Future<Null>.delayed(new Duration(milliseconds: 1000));
}
}, timeout: new Timeout(new Duration(minutes: 1)));
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment