Skip to content

Commit 3071650

Browse files
committed
Fix shared utilities for remote workloads
- test-invoker: Propagate results in AsyncRAFTestInvoker so BenchmarkSuite.runAndRecord receives timing data instead of undefined. - test-runner: Add null-page fallback in measureAsync so remote workloads that pass null for frame/page can still force layout.
1 parent 749af70 commit 3071650

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

resources/shared/test-invoker.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class AsyncRAFTestInvoker extends TestInvoker {
4444

4545
this._asyncCallback();
4646
setTimeout(async () => {
47-
await this._reportCallback();
48-
resolve();
47+
const results = await this._reportCallback();
48+
resolve(results);
4949
}, 0);
5050
};
5151

resources/shared/test-runner.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ export class TestRunner {
6969
const measureAsync = () => {
7070
// Some browsers don't immediately update the layout for paint.
7171
// Force the layout here to ensure we're measuring the layout time.
72-
this.page.layout();
72+
if (this.page) {
73+
this.page.layout();
74+
} else {
75+
const body = document.body;
76+
const height = body.getBoundingClientRect().height;
77+
body._leakedLayoutValue = height;
78+
}
7379

7480
const asyncEndTime = performance.now();
7581
performance.mark(asyncEndLabel);

0 commit comments

Comments
 (0)