diff --git a/resources/benchmark-runner.mjs b/resources/benchmark-runner.mjs index 6a77a1cfd..257fca726 100644 --- a/resources/benchmark-runner.mjs +++ b/resources/benchmark-runner.mjs @@ -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(); @@ -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() { @@ -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; diff --git a/resources/suite-runner.mjs b/resources/suite-runner.mjs index 9b0084392..899d11c59 100644 --- a/resources/suite-runner.mjs +++ b/resources/suite-runner.mjs @@ -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]; @@ -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); } }