From 7ba8957b12dfc560613d225a6380926ed70aa1e9 Mon Sep 17 00:00:00 2001 From: Nate Biggs Date: Tue, 24 Sep 2024 15:53:30 +0000 Subject: [PATCH] [dart2wasm] Add FluteComplex multi-module stress test. Change-Id: I2b13649d67d5b68211b6c15c745fd194773b9e7f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386380 Reviewed-by: Martin Kustermann Commit-Queue: Nate Biggs --- tests/web/wasm/flute_stress_test.dart | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/web/wasm/flute_stress_test.dart diff --git a/tests/web/wasm/flute_stress_test.dart b/tests/web/wasm/flute_stress_test.dart new file mode 100644 index 00000000000..fcf9bfde6ad --- /dev/null +++ b/tests/web/wasm/flute_stress_test.dart @@ -0,0 +1,24 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// dart2wasmOptions=--extra-compiler-option=--enable-multi-module-stress-test-mode + +import 'dart:async'; + +import 'package:async_helper/async_helper.dart'; +import '../../../third_party/flute/benchmarks/lib/complex.dart' as flute; + +main() { + asyncStart(); + int frames = 0; + runZoned(() { + final startTime = '${DateTime.now().microsecondsSinceEpoch / 1000000}'; + flute.main([startTime, '10']); + }, zoneSpecification: ZoneSpecification(print: (_, parent, zone, line) { + parent.print(zone, line); + if (line.contains('AverageFrame')) { + asyncEnd(); + } + })); +}