Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Reenable web benchmarks #604

Merged
merged 2 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ packages:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.8"
version: "3.1.11"
args:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -296,7 +296,7 @@ packages:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "0.1.4"
meta:
dependency: "direct main"
description:
Expand Down Expand Up @@ -602,7 +602,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -728,7 +728,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
vm_service:
dependency: transitive
description:
Expand All @@ -746,10 +746,10 @@ packages:
web_benchmarks:
dependency: "direct dev"
description:
name: web_benchmarks
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.5"
path: "../packages/packages/web_benchmarks"
relative: true
source: path
version: "0.0.7"
web_socket_channel:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dev_dependencies:
path: ^1.8.0
string_scanner: ^1.1.0
test: ^1.16.8
web_benchmarks: ^0.0.5
web_benchmarks: ^0.0.7

flutter:
deferred-components:
Expand Down
20 changes: 10 additions & 10 deletions test_benchmarks/benchmarks/gallery_automator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// @dart=2.9

import 'dart:io';
// ignore_for_file:avoid_print

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
Expand Down Expand Up @@ -87,13 +87,13 @@ class GalleryAutomator {
Future<void> automateDemoGestures() async {
await warmUp();

stdout.writeln('==== List of demos to be run ====');
print('==== List of demos to be run ====');
for (final demo in demoNames) {
if (shouldRunPredicate(demo)) {
stdout.writeln(demo);
print(demo);
}
}
stdout.writeln('==== End of list of demos to be run ====');
print('==== End of list of demos to be run ====');

var finishedStudyDemos = false;

Expand Down Expand Up @@ -121,7 +121,7 @@ class GalleryAutomator {
// satisfying `runCriterion`, because we need to scroll
// through every `Scrollable` to find the `demoButton`.
if (shouldRunPredicate(demo)) {
stdout.writeln('Running demo "$demo"');
print('Running demo "$demo"');

for (var i = 0; i < 2; ++i) {
await controller.tap(find.byKey(ValueKey(demo)));
Expand All @@ -139,7 +139,7 @@ class GalleryAutomator {
}
}

stdout.writeln('All demos finished.');
print('All demos finished.');

// At the end of the test, mark as finished.
finished = true;
Expand All @@ -149,7 +149,7 @@ class GalleryAutomator {
Future<void> automateScrolls() async {
await warmUp();

stdout.writeln('Running scrolling test.');
print('Running scrolling test.');

final selectedDemos = firstDemosOfCategories(demoNames);

Expand Down Expand Up @@ -182,13 +182,13 @@ class GalleryAutomator {
}
}

stdout.writeln('Scrolling test finished.');
print('Scrolling test finished.');
finished = true;
}

/// Warm up the animation.
Future<void> warmUp() async {
stdout.writeln('Warming up.');
print('Warming up.');

await pumpDeferredLibraries();

Expand Down Expand Up @@ -231,7 +231,7 @@ class GalleryAutomator {
// When warm-up finishes, inform the recorder.
stopWarmingUpCallback();

stdout.writeln('Warm-up finished.');
print('Warm-up finished.');
}

/// A function to find the category of a demo.
Expand Down
3 changes: 0 additions & 3 deletions test_benchmarks/benchmarks_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ Future<void> main() async {
test('Can run a web benchmark', () async {
stdout.writeln('Starting web benchmark tests ...');

// TODO(pennzht): Re-enable this test, https://github.com/flutter/gallery/issues/463.
return;
// ignore: dead_code
final taskResult = await serveWebBenchmark(
benchmarkAppDirectory: projectRootDirectory(),
entryPoint: 'test_benchmarks/benchmarks/client.dart',
Expand Down