From a856d1947fffb6f4ec09ad603eda2a5e4af8d307 Mon Sep 17 00:00:00 2001 From: Kenzie Schmoll Date: Tue, 2 Jul 2024 12:10:11 -0700 Subject: [PATCH] Migrate to `web_benchmarks` 2.0.0 --- .../benchmark/devtools_benchmarks_test.dart | 21 +++++++++++-------- .../benchmark/scripts/run_benchmarks.dart | 9 +++----- packages/devtools_app/pubspec.yaml | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/devtools_app/benchmark/devtools_benchmarks_test.dart b/packages/devtools_app/benchmark/devtools_benchmarks_test.dart index 35d687a7261..3a2f8ee0f47 100644 --- a/packages/devtools_app/benchmark/devtools_benchmarks_test.dart +++ b/packages/devtools_app/benchmark/devtools_benchmarks_test.dart @@ -29,14 +29,15 @@ final valueList = [ /// Tests that the DevTools web benchmarks are run and reported correctly. void main() { - test( - 'Can run web benchmarks', - () async { - await _runBenchmarks(); - }, - timeout: const Timeout(Duration(minutes: 10)), - ); - + for (final useWasm in [true, false]) { + test( + 'Can run web benchmarks with ${useWasm ? 'JS' : 'WASM'}', + () async { + await _runBenchmarks(useWasm: useWasm); + }, + timeout: const Timeout(Duration(minutes: 10)), + ); + } // TODO(kenz): add tests that verify performance meets some expected threshold } @@ -45,7 +46,9 @@ Future _runBenchmarks({bool useWasm = false}) async { final taskResult = await serveWebBenchmark( benchmarkAppDirectory: projectRootDirectory(), entryPoint: 'benchmark/test_infra/client.dart', - compilationOptions: CompilationOptions(useWasm: useWasm), + compilationOptions: useWasm + ? const CompilationOptions.wasm() + : const CompilationOptions.js(), treeShakeIcons: false, initialPage: benchmarkInitialPage, ); diff --git a/packages/devtools_app/benchmark/scripts/run_benchmarks.dart b/packages/devtools_app/benchmark/scripts/run_benchmarks.dart index b32f544efc6..209cc3160ee 100644 --- a/packages/devtools_app/benchmark/scripts/run_benchmarks.dart +++ b/packages/devtools_app/benchmark/scripts/run_benchmarks.dart @@ -31,12 +31,9 @@ Future main(List args) async { await serveWebBenchmark( benchmarkAppDirectory: projectRootDirectory(), entryPoint: 'benchmark/test_infra/client.dart', - compilationOptions: CompilationOptions( - useWasm: benchmarkArgs.useWasm, - renderer: benchmarkArgs.useSkwasm - ? WebRenderer.skwasm - : WebRenderer.canvaskit, - ), + compilationOptions: benchmarkArgs.useWasm + ? const CompilationOptions.wasm() + : const CompilationOptions.js(), treeShakeIcons: false, initialPage: benchmarkInitialPage, headless: !benchmarkArgs.useBrowser, diff --git a/packages/devtools_app/pubspec.yaml b/packages/devtools_app/pubspec.yaml index 1700095c701..de08471e7f6 100644 --- a/packages/devtools_app/pubspec.yaml +++ b/packages/devtools_app/pubspec.yaml @@ -81,7 +81,7 @@ dev_dependencies: mockito: ^5.4.1 stager: ^1.0.1 test: ^1.21.0 - web_benchmarks: ^1.1.0 + web_benchmarks: ^2.0.0 webkit_inspection_protocol: ">=0.5.0 <2.0.0" flutter: