Skip to content

Commit

Permalink
Cleanup to prepare for postMessage / remote runner (WebKit#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
flashdesignory authored Oct 21, 2024
1 parent 2387b9f commit 3ce6105
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions resources/benchmark-runner.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,6 @@ export class BenchmarkRunner {
const prepareEndLabel = "runner-prepare-end";

performance.mark(prepareStartLabel);
this._removeFrame();
await this._appendFrame();
this._page = new Page(this._frame);

let suites = [...this._suites];
if (this._suiteOrderRandomNumberGenerator)
this._shuffleSuites(suites);
Expand All @@ -432,10 +428,17 @@ export class BenchmarkRunner {
const suites = await this._prepareAllSuites();
try {
for (const suite of suites) {
if (!suite.disabled)
if (suite.disabled)
continue;

try {
await this._appendFrame();
this._page = new Page(this._frame);
await this.runSuite(suite);
} finally {
this._removeFrame();
}
}

} finally {
await this._finishRunAllSuites();
}
Expand All @@ -446,8 +449,6 @@ export class BenchmarkRunner {
const finalizeEndLabel = "runner-finalize-end";

performance.mark(finalizeStartLabel);
// Remove frame to clear the view for displaying the results.
this._removeFrame();
await this._finalize();
performance.mark(finalizeEndLabel);
performance.measure("runner-finalize", finalizeStartLabel, finalizeEndLabel);
Expand Down
2 changes: 1 addition & 1 deletion tests/benchmark-runner-tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe("BenchmarkRunner", () => {

it("should remove the previous frame and then the current frame", () => {
assert.calledTwice(_loadFrameStub);
assert.calledOnce(_appendFrameStub);
assert.calledTwice(_appendFrameStub);
assert.calledTwice(_removeFrameStub);
});

Expand Down

0 comments on commit 3ce6105

Please sign in to comment.