Skip to content

Commit

Permalink
Include query params
Browse files Browse the repository at this point in the history
  • Loading branch information
kenzieschmoll committed Sep 11, 2024
1 parent d8c88b6 commit 337285a
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ Future<void> _runBenchmarks({bool useWasm = false}) async {
stdout.writeln('Starting web benchmark tests ...');
final taskResult = await serveWebBenchmark(
benchmarkAppDirectory: projectRootDirectory(),
entryPoint: 'benchmark/test_infra/client.dart',
entryPoint:
'benchmark/test_infra/client/client_${useWasm ? 'wasm' : 'js'}.dart',
compilationOptions: useWasm
? const CompilationOptions.wasm()
: const CompilationOptions.js(),
treeShakeIcons: false,
initialPage: benchmarkInitialPage,
queryParameters: useWasm ? wasmQueryParameters : null,
);
stdout.writeln('Web benchmark tests finished.');

Expand Down
17 changes: 17 additions & 0 deletions packages/devtools_app/benchmark/test_infra/client/client_js.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2023 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:web_benchmarks/client.dart';

import '../common.dart';
import 'client_shared.dart';

/// Runs the client of the DevTools web benchmarks.
///
/// When the DevTools web benchmarks are run, the server builds an app with this
/// file as the entry point (see `run_benchmarks.dart`). The app automates
/// the DevTools web app, records some performance data, and reports them.
Future<void> main() async {
await runBenchmarks(benchmarks, initialPage: benchmarkInitialPage);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2023 The Chromium Authors. All rights reserved.
// Copyright 2024 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:web_benchmarks/client.dart';

import 'common.dart';
import 'devtools_recorder.dart';
import '../common.dart';
import '../devtools_recorder.dart';

typedef RecorderFactory = Recorder Function();

Expand All @@ -20,12 +20,3 @@ final benchmarks = <String, RecorderFactory>{
benchmark: DevToolsBenchmark.offlinePerformanceScreen,
),
};

/// Runs the client of the DevTools web benchmarks.
///
/// When the DevTools web benchmarks are run, the server builds an app with this
/// file as the entry point (see `run_benchmarks.dart`). The app automates
/// the DevTools web app, records some performance data, and reports them.
Future<void> main() async {
await runBenchmarks(benchmarks, initialPage: benchmarkInitialPage);
}
21 changes: 21 additions & 0 deletions packages/devtools_app/benchmark/test_infra/client/client_wasm.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2024 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:web_benchmarks/client.dart';

import '../common.dart';
import 'client_shared.dart';

/// Runs the client of the DevTools web benchmarks.
///
/// When the DevTools web benchmarks are run, the server builds an app with this
/// file as the entry point (see `run_benchmarks.dart`). The app automates
/// the DevTools web app, records some performance data, and reports them.
Future<void> main() async {
await runBenchmarks(
benchmarks,
initialPage: benchmarkInitialPage,
queryParameters: wasmQueryParameters,
);
}
2 changes: 2 additions & 0 deletions packages/devtools_app/benchmark/test_infra/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
// found" in DevTools.
const benchmarkInitialPage = '';

const wasmQueryParameters = {'wasm': 'true'};

const devtoolsBenchmarkPrefix = 'devtools';

enum DevToolsBenchmark {
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ dev_dependencies:
mockito: ^5.4.1
stager: ^1.0.1
test: ^1.21.0
web_benchmarks: ^2.0.2
web_benchmarks: ^2.1.0
webkit_inspection_protocol: ">=0.5.0 <2.0.0"

flutter:
Expand Down

0 comments on commit 337285a

Please sign in to comment.