Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 3 additions & 6 deletions resources/benchmark-runner.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,7 @@ export class BenchmarkRunner {

async runMultipleIterations(iterationCount) {
this._iterationCount = iterationCount;
if (this._client?.willStartFirstIteration)
await this._client.willStartFirstIteration(iterationCount);
await this._client?.willStartFirstIteration?.(iterationCount);

try {
await this._runMultipleIterations();
Expand All @@ -345,8 +344,7 @@ export class BenchmarkRunner {
}
}

if (this._client?.didFinishLastIteration)
await this._client.didFinishLastIteration(this._metrics);
await this._client?.didFinishLastIteration?.(this._metrics);
}

async _runMultipleIterations() {
Expand Down Expand Up @@ -380,8 +378,7 @@ export class BenchmarkRunner {
style.top = "50%";
style.transform = "translate(-50%, -50%)";

if (this._client?.willAddTestFrame)
await this._client.willAddTestFrame(frame);
await this._client?.willAddTestFrame?.(frame);

document.body.insertBefore(frame, document.body.firstChild);
this._frame = frame;
Expand Down
6 changes: 2 additions & 4 deletions resources/suite-runner.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ export class SuiteRunner {

performance.mark(suiteStartLabel);
for (const step of this.#suite.tests) {
if (this.#client?.willRunTest)
await this.#client.willRunTest(this.#suite, step);
await this.#client?.willRunTest?.(this.#suite, step);

const stepRunnerType = this.#suite.type ?? this.params.useAsyncSteps ? "async" : "default";
const stepRunnerClass = STEP_RUNNER_LOOKUP[stepRunnerType];
Expand Down Expand Up @@ -139,8 +138,7 @@ export class SuiteRunner {
}

async _updateClient(suite = this.#suite) {
if (this.#client?.didFinishSuite)
await this.#client.didFinishSuite(suite);
await this.#client?.didFinishSuite?.(suite);
}
}

Expand Down
Loading