Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
fix test
  • Loading branch information
kenzieschmoll committed Sep 12, 2024
commit dfd6d34214b0f1c61139729ea0e71666568b6a39
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,27 @@ Future<void> main() async {
timeout: Timeout.none,
);

test(
'Can run a web benchmark with an alternate initial page',
() async {
final BenchmarkResults results = await _runBenchmarks(
benchmarkNames: <String>['simple'],
entryPoint: 'lib/benchmarks/runner_simple.dart',
initialPage: 'index.html#about',
);

// The simple runner just puts an `isWasm` metric in there so we can make
// sure that we're running in the right environment.
final List<BenchmarkScore>? scores = results.scores['simple'];
expect(scores, isNotNull);

final BenchmarkScore isWasmScore = scores!
.firstWhere((BenchmarkScore score) => score.metric == 'isWasm');
expect(isWasmScore.value, 0);
},
timeout: Timeout.none,
);

test(
'Can run a web benchmark with wasm',
() async {
Expand Down Expand Up @@ -55,14 +76,14 @@ Future<void> main() async {
Future<BenchmarkResults> _runBenchmarks({
required List<String> benchmarkNames,
required String entryPoint,
String benchmarkPath = defaultInitialPath,
String initialPage = defaultInitialPage,
CompilationOptions compilationOptions = const CompilationOptions.js(),
}) async {
final BenchmarkResults taskResult = await serveWebBenchmark(
benchmarkAppDirectory: Directory('testing/test_app'),
entryPoint: entryPoint,
treeShakeIcons: false,
benchmarkPath: benchmarkPath,
initialPage: initialPage,
compilationOptions: compilationOptions,
);

Expand Down