From ff87da36e7db56c8f4138103e9f69f6b35c69c61 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 7 Jun 2021 21:04:08 +0200 Subject: [PATCH] refactor(benchpress): ensure compatibility with noImplicitOverride (#42512) Adds the `override` keyword to the `benchpress` sources to ensure compatibility with `noImplicitOverride`. PR Close #42512 --- packages/benchpress/src/metric/multi_metric.ts | 6 +++--- packages/benchpress/src/metric/perflog_metric.ts | 6 +++--- packages/benchpress/src/metric/user_metric.ts | 6 +++--- .../benchpress/src/reporter/console_reporter.ts | 5 +++-- .../benchpress/src/reporter/json_file_reporter.ts | 5 +++-- packages/benchpress/src/reporter/multi_reporter.ts | 5 +++-- .../src/validator/regression_slope_validator.ts | 4 ++-- packages/benchpress/src/validator/size_validator.ts | 4 ++-- .../src/webdriver/chrome_driver_extension.ts | 12 ++++++------ .../src/webdriver/firefox_driver_extension.ts | 12 ++++++------ .../src/webdriver/ios_driver_extension.ts | 12 ++++++------ .../src/webdriver/selenium_webdriver_adapter.ts | 10 +++++----- .../benchpress/test/metric/multi_metric_spec.ts | 6 +++--- .../benchpress/test/metric/perflog_metric_spec.ts | 10 +++++----- packages/benchpress/test/metric/user_metric_spec.ts | 2 +- .../benchpress/test/reporter/multi_reporter_spec.ts | 4 ++-- packages/benchpress/test/runner_spec.ts | 10 +++++----- packages/benchpress/test/sampler_spec.ts | 13 +++++++------ .../benchpress/test/web_driver_extension_spec.ts | 2 +- .../test/webdriver/chrome_driver_extension_spec.ts | 4 ++-- .../test/webdriver/ios_driver_extension_spec.ts | 4 ++-- 21 files changed, 73 insertions(+), 69 deletions(-) diff --git a/packages/benchpress/src/metric/multi_metric.ts b/packages/benchpress/src/metric/multi_metric.ts index c494363c4f..7b26ea4883 100644 --- a/packages/benchpress/src/metric/multi_metric.ts +++ b/packages/benchpress/src/metric/multi_metric.ts @@ -33,7 +33,7 @@ export class MultiMetric extends Metric { /** * Starts measuring */ - beginMeasure(): Promise { + override beginMeasure(): Promise { return Promise.all(this._metrics.map(metric => metric.beginMeasure())); } @@ -42,7 +42,7 @@ export class MultiMetric extends Metric { * since the begin call. * @param restart: Whether to restart right after this. */ - endMeasure(restart: boolean): Promise<{[key: string]: any}> { + override endMeasure(restart: boolean): Promise<{[key: string]: any}> { return Promise.all(this._metrics.map(metric => metric.endMeasure(restart))) .then(values => mergeStringMaps(values)); } @@ -51,7 +51,7 @@ export class MultiMetric extends Metric { * Describes the metrics provided by this metric implementation. * (e.g. units, ...) */ - describe(): {[key: string]: any} { + override describe(): {[key: string]: any} { return mergeStringMaps(this._metrics.map((metric) => metric.describe())); } } diff --git a/packages/benchpress/src/metric/perflog_metric.ts b/packages/benchpress/src/metric/perflog_metric.ts index d68acdff45..a506a17f78 100644 --- a/packages/benchpress/src/metric/perflog_metric.ts +++ b/packages/benchpress/src/metric/perflog_metric.ts @@ -69,7 +69,7 @@ export class PerflogMetric extends Metric { } } - describe(): {[key: string]: string} { + override describe(): {[key: string]: string} { const res: {[key: string]: any} = { 'scriptTime': 'script execution time in ms, including gc and render', 'pureScriptTime': 'script execution time in ms, without gc nor render' @@ -113,7 +113,7 @@ export class PerflogMetric extends Metric { return res; } - beginMeasure(): Promise { + override beginMeasure(): Promise { let resultPromise = Promise.resolve(null); if (this._forceGc) { resultPromise = resultPromise.then((_) => this._driverExtension.gc()); @@ -121,7 +121,7 @@ export class PerflogMetric extends Metric { return resultPromise.then((_) => this._beginMeasure()); } - endMeasure(restart: boolean): Promise<{[key: string]: number}> { + override endMeasure(restart: boolean): Promise<{[key: string]: number}> { if (this._forceGc) { return this._endPlainMeasureAndMeasureForceGc(restart); } else { diff --git a/packages/benchpress/src/metric/user_metric.ts b/packages/benchpress/src/metric/user_metric.ts index cf91050a7b..2b9eaeb4f7 100644 --- a/packages/benchpress/src/metric/user_metric.ts +++ b/packages/benchpress/src/metric/user_metric.ts @@ -26,14 +26,14 @@ export class UserMetric extends Metric { /** * Starts measuring */ - beginMeasure(): Promise { + override beginMeasure(): Promise { return Promise.resolve(true); } /** * Ends measuring. */ - endMeasure(restart: boolean): Promise<{[key: string]: any}> { + override endMeasure(restart: boolean): Promise<{[key: string]: any}> { let resolve: (result: any) => void; let reject: (error: any) => void; const promise = new Promise<{[key: string]: any;}>((res, rej) => { @@ -68,7 +68,7 @@ export class UserMetric extends Metric { * Describes the metrics provided by this metric implementation. * (e.g. units, ...) */ - describe(): {[key: string]: any} { + override describe(): {[key: string]: any} { return this._userMetrics; } } diff --git a/packages/benchpress/src/reporter/console_reporter.ts b/packages/benchpress/src/reporter/console_reporter.ts index 4a5755cb47..da2a96f902 100644 --- a/packages/benchpress/src/reporter/console_reporter.ts +++ b/packages/benchpress/src/reporter/console_reporter.ts @@ -71,7 +71,7 @@ export class ConsoleReporter extends Reporter { this._printStringRow(this._metricNames.map((_) => ''), '-'); } - reportMeasureValues(measureValues: MeasureValues): Promise { + override reportMeasureValues(measureValues: MeasureValues): Promise { const formattedValues = this._metricNames.map(metricName => { const value = measureValues.values[metricName]; return formatNum(value); @@ -80,7 +80,8 @@ export class ConsoleReporter extends Reporter { return Promise.resolve(null); } - reportSample(completeSample: MeasureValues[], validSamples: MeasureValues[]): Promise { + override reportSample(completeSample: MeasureValues[], validSamples: MeasureValues[]): + Promise { this._printStringRow(this._metricNames.map((_) => ''), '='); this._printStringRow( this._metricNames.map(metricName => formatStats(validSamples, metricName))); diff --git a/packages/benchpress/src/reporter/json_file_reporter.ts b/packages/benchpress/src/reporter/json_file_reporter.ts index 7abb45f09d..fbde2a26cb 100644 --- a/packages/benchpress/src/reporter/json_file_reporter.ts +++ b/packages/benchpress/src/reporter/json_file_reporter.ts @@ -37,11 +37,12 @@ export class JsonFileReporter extends Reporter { super(); } - reportMeasureValues(measureValues: MeasureValues): Promise { + override reportMeasureValues(measureValues: MeasureValues): Promise { return Promise.resolve(null); } - reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): Promise { + override reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): + Promise { const stats: {[key: string]: string} = {}; sortedProps(this._description.metrics).forEach((metricName) => { stats[metricName] = formatStats(validSample, metricName); diff --git a/packages/benchpress/src/reporter/multi_reporter.ts b/packages/benchpress/src/reporter/multi_reporter.ts index aefadc18f9..81122c4c46 100644 --- a/packages/benchpress/src/reporter/multi_reporter.ts +++ b/packages/benchpress/src/reporter/multi_reporter.ts @@ -31,11 +31,12 @@ export class MultiReporter extends Reporter { super(); } - reportMeasureValues(values: MeasureValues): Promise { + override reportMeasureValues(values: MeasureValues): Promise { return Promise.all(this._reporters.map(reporter => reporter.reportMeasureValues(values))); } - reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): Promise { + override reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): + Promise { return Promise.all( this._reporters.map(reporter => reporter.reportSample(completeSample, validSample))); } diff --git a/packages/benchpress/src/validator/regression_slope_validator.ts b/packages/benchpress/src/validator/regression_slope_validator.ts index 40d72e9cfb..82eb82ab1d 100644 --- a/packages/benchpress/src/validator/regression_slope_validator.ts +++ b/packages/benchpress/src/validator/regression_slope_validator.ts @@ -35,11 +35,11 @@ export class RegressionSlopeValidator extends Validator { super(); } - describe(): {[key: string]: any} { + override describe(): {[key: string]: any} { return {'sampleSize': this._sampleSize, 'regressionSlopeMetric': this._metric}; } - validate(completeSample: MeasureValues[]): MeasureValues[]|null { + override validate(completeSample: MeasureValues[]): MeasureValues[]|null { if (completeSample.length >= this._sampleSize) { const latestSample = completeSample.slice(completeSample.length - this._sampleSize, completeSample.length); diff --git a/packages/benchpress/src/validator/size_validator.ts b/packages/benchpress/src/validator/size_validator.ts index 7120ca6de0..6fcf182504 100644 --- a/packages/benchpress/src/validator/size_validator.ts +++ b/packages/benchpress/src/validator/size_validator.ts @@ -26,11 +26,11 @@ export class SizeValidator extends Validator { super(); } - describe(): {[key: string]: any} { + override describe(): {[key: string]: any} { return {'sampleSize': this._sampleSize}; } - validate(completeSample: MeasureValues[]): MeasureValues[]|null { + override validate(completeSample: MeasureValues[]): MeasureValues[]|null { if (completeSample.length >= this._sampleSize) { return completeSample.slice(completeSample.length - this._sampleSize, completeSample.length); } else { diff --git a/packages/benchpress/src/webdriver/chrome_driver_extension.ts b/packages/benchpress/src/webdriver/chrome_driver_extension.ts index 9fecaa33a3..01ca950645 100644 --- a/packages/benchpress/src/webdriver/chrome_driver_extension.ts +++ b/packages/benchpress/src/webdriver/chrome_driver_extension.ts @@ -54,11 +54,11 @@ export class ChromeDriverExtension extends WebDriverExtension { return parseInt(v, 10); } - gc() { + override gc() { return this.driver.executeScript('window.gc()'); } - async timeBegin(name: string): Promise { + override async timeBegin(name: string): Promise { if (this._firstRun) { this._firstRun = false; // Before the first run, read out the existing performance logs @@ -68,7 +68,7 @@ export class ChromeDriverExtension extends WebDriverExtension { return this.driver.executeScript(`performance.mark('${name}-bpstart');`); } - timeEnd(name: string, restartName: string|null = null): Promise { + override timeEnd(name: string, restartName: string|null = null): Promise { let script = `performance.mark('${name}-bpend');`; if (restartName) { script += `performance.mark('${restartName}-bpstart');`; @@ -78,7 +78,7 @@ export class ChromeDriverExtension extends WebDriverExtension { // See [Chrome Trace Event // Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/edit) - readPerfLog(): Promise { + override readPerfLog(): Promise { // TODO(tbosch): Chromedriver bug https://code.google.com/p/chromedriver/issues/detail?id=1098 // Need to execute at least one command so that the browser logs can be read out! return this.driver.executeScript('1+1') @@ -200,11 +200,11 @@ export class ChromeDriverExtension extends WebDriverExtension { return !expectedName ? hasCategories : hasCategories && eventName === expectedName; } - perfLogFeatures(): PerfLogFeatures { + override perfLogFeatures(): PerfLogFeatures { return new PerfLogFeatures({render: true, gc: true, frameCapture: true, userTiming: true}); } - supports(capabilities: {[key: string]: any}): boolean { + override supports(capabilities: {[key: string]: any}): boolean { return this._majorChromeVersion >= 44 && capabilities['browserName'].toLowerCase() === 'chrome'; } } diff --git a/packages/benchpress/src/webdriver/firefox_driver_extension.ts b/packages/benchpress/src/webdriver/firefox_driver_extension.ts index a56498f8d0..4f2673f989 100644 --- a/packages/benchpress/src/webdriver/firefox_driver_extension.ts +++ b/packages/benchpress/src/webdriver/firefox_driver_extension.ts @@ -22,11 +22,11 @@ export class FirefoxDriverExtension extends WebDriverExtension { this._profilerStarted = false; } - gc() { + override gc() { return this._driver.executeScript('window.forceGC()'); } - timeBegin(name: string): Promise { + override timeBegin(name: string): Promise { if (!this._profilerStarted) { this._profilerStarted = true; this._driver.executeScript('window.startProfiler();'); @@ -34,7 +34,7 @@ export class FirefoxDriverExtension extends WebDriverExtension { return this._driver.executeScript('window.markStart("' + name + '");'); } - timeEnd(name: string, restartName: string|null = null): Promise { + override timeEnd(name: string, restartName: string|null = null): Promise { let script = 'window.markEnd("' + name + '");'; if (restartName != null) { script += 'window.markStart("' + restartName + '");'; @@ -42,15 +42,15 @@ export class FirefoxDriverExtension extends WebDriverExtension { return this._driver.executeScript(script); } - readPerfLog(): Promise { + override readPerfLog(): Promise { return this._driver.executeAsyncScript('var cb = arguments[0]; window.getProfile(cb);'); } - perfLogFeatures(): PerfLogFeatures { + override perfLogFeatures(): PerfLogFeatures { return new PerfLogFeatures({render: true, gc: true}); } - supports(capabilities: {[key: string]: any}): boolean { + override supports(capabilities: {[key: string]: any}): boolean { return capabilities['browserName'].toLowerCase() === 'firefox'; } } diff --git a/packages/benchpress/src/webdriver/ios_driver_extension.ts b/packages/benchpress/src/webdriver/ios_driver_extension.ts index 5da139a7e8..4e99d73684 100644 --- a/packages/benchpress/src/webdriver/ios_driver_extension.ts +++ b/packages/benchpress/src/webdriver/ios_driver_extension.ts @@ -19,15 +19,15 @@ export class IOsDriverExtension extends WebDriverExtension { super(); } - gc(): Promise { + override gc(): Promise { throw new Error('Force GC is not supported on iOS'); } - timeBegin(name: string): Promise { + override timeBegin(name: string): Promise { return this._driver.executeScript(`console.time('${name}');`); } - timeEnd(name: string, restartName: string|null = null): Promise { + override timeEnd(name: string, restartName: string|null = null): Promise { let script = `console.timeEnd('${name}');`; if (restartName != null) { script += `console.time('${restartName}');`; @@ -36,7 +36,7 @@ export class IOsDriverExtension extends WebDriverExtension { } // See https://github.com/WebKit/webkit/tree/master/Source/WebInspectorUI/Versions - readPerfLog() { + override readPerfLog() { // TODO(tbosch): Bug in IOsDriver: Need to execute at least one command // so that the browser logs can be read out! return this._driver.executeScript('1+1') @@ -91,11 +91,11 @@ export class IOsDriverExtension extends WebDriverExtension { return events; } - perfLogFeatures(): PerfLogFeatures { + override perfLogFeatures(): PerfLogFeatures { return new PerfLogFeatures({render: true}); } - supports(capabilities: {[key: string]: any}): boolean { + override supports(capabilities: {[key: string]: any}): boolean { return capabilities['browserName'].toLowerCase() === 'safari'; } } diff --git a/packages/benchpress/src/webdriver/selenium_webdriver_adapter.ts b/packages/benchpress/src/webdriver/selenium_webdriver_adapter.ts index 3719de05ed..8ed82832d5 100644 --- a/packages/benchpress/src/webdriver/selenium_webdriver_adapter.ts +++ b/packages/benchpress/src/webdriver/selenium_webdriver_adapter.ts @@ -25,19 +25,19 @@ export class SeleniumWebDriverAdapter extends WebDriverAdapter { super(); } - waitFor(callback: () => any): Promise { + override waitFor(callback: () => any): Promise { return this._driver.call(callback); } - executeScript(script: string): Promise { + override executeScript(script: string): Promise { return this._driver.executeScript(script); } - executeAsyncScript(script: string): Promise { + override executeAsyncScript(script: string): Promise { return this._driver.executeAsyncScript(script); } - capabilities(): Promise<{[key: string]: any}> { + override capabilities(): Promise<{[key: string]: any}> { return this._driver.getCapabilities().then((capsObject: any) => { const localData: {[key: string]: any} = {}; for (const key of Array.from((>capsObject).keys())) { @@ -47,7 +47,7 @@ export class SeleniumWebDriverAdapter extends WebDriverAdapter { }); } - logs(type: string): Promise { + override logs(type: string): Promise { // Needed as selenium-webdriver does not forward // performance logs in the correct way via manage().logs return this._driver.schedule( diff --git a/packages/benchpress/test/metric/multi_metric_spec.ts b/packages/benchpress/test/metric/multi_metric_spec.ts index bc3ab5ca33..98c28c6821 100644 --- a/packages/benchpress/test/metric/multi_metric_spec.ts +++ b/packages/benchpress/test/metric/multi_metric_spec.ts @@ -50,17 +50,17 @@ class MockMetric extends Metric { super(); } - beginMeasure(): Promise { + override beginMeasure(): Promise { return Promise.resolve(`${this._id}_beginMeasure`); } - endMeasure(restart: boolean): Promise<{[key: string]: any}> { + override endMeasure(restart: boolean): Promise<{[key: string]: any}> { const result: {[key: string]: any} = {}; result[this._id] = {'restart': restart}; return Promise.resolve(result); } - describe(): {[key: string]: string} { + override describe(): {[key: string]: string} { const result: {[key: string]: string} = {}; result[this._id] = 'describe'; return result; diff --git a/packages/benchpress/test/metric/perflog_metric_spec.ts b/packages/benchpress/test/metric/perflog_metric_spec.ts index b93046ac89..0fd70d3180 100644 --- a/packages/benchpress/test/metric/perflog_metric_spec.ts +++ b/packages/benchpress/test/metric/perflog_metric_spec.ts @@ -646,21 +646,21 @@ class MockDriverExtension extends WebDriverExtension { super(); } - timeBegin(name: string): Promise { + override timeBegin(name: string): Promise { this._commandLog.push(['timeBegin', name]); return Promise.resolve(null); } - timeEnd(name: string, restartName: string|null): Promise { + override timeEnd(name: string, restartName: string|null): Promise { this._commandLog.push(['timeEnd', name, restartName]); return Promise.resolve(null); } - perfLogFeatures(): PerfLogFeatures { + override perfLogFeatures(): PerfLogFeatures { return this._perfLogFeatures; } - readPerfLog(): Promise { + override readPerfLog(): Promise { this._commandLog.push('readPerfLog'); if (this._perfLogs.length > 0) { const next = this._perfLogs[0]; @@ -671,7 +671,7 @@ class MockDriverExtension extends WebDriverExtension { } } - gc(): Promise { + override gc(): Promise { this._commandLog.push(['gc']); return Promise.resolve(null); } diff --git a/packages/benchpress/test/metric/user_metric_spec.ts b/packages/benchpress/test/metric/user_metric_spec.ts index 419caca3d4..70e3242a31 100644 --- a/packages/benchpress/test/metric/user_metric_spec.ts +++ b/packages/benchpress/test/metric/user_metric_spec.ts @@ -64,7 +64,7 @@ describe('user metric', () => { class MockDriverAdapter extends WebDriverAdapter { data: any = {}; - executeScript(script: string): any { + override executeScript(script: string): any { // Just handles `return window.propName` ignores `delete window.propName`. if (script.indexOf('return window.') == 0) { const metricName = script.substring('return window.'.length); diff --git a/packages/benchpress/test/reporter/multi_reporter_spec.ts b/packages/benchpress/test/reporter/multi_reporter_spec.ts index 494d909836..fc39c60f84 100644 --- a/packages/benchpress/test/reporter/multi_reporter_spec.ts +++ b/packages/benchpress/test/reporter/multi_reporter_spec.ts @@ -51,11 +51,11 @@ class MockReporter extends Reporter { super(); } - reportMeasureValues(values: MeasureValues): Promise<{[key: string]: any}> { + override reportMeasureValues(values: MeasureValues): Promise<{[key: string]: any}> { return Promise.resolve({'id': this._id, 'values': values}); } - reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): + override reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): Promise<{[key: string]: any}> { return Promise.resolve( {'id': this._id, 'completeSample': completeSample, 'validSample': validSample}); diff --git a/packages/benchpress/test/runner_spec.ts b/packages/benchpress/test/runner_spec.ts index d304fa356b..6026956a3e 100644 --- a/packages/benchpress/test/runner_spec.ts +++ b/packages/benchpress/test/runner_spec.ts @@ -106,10 +106,10 @@ import {Injector, Metric, Options, Runner, SampleDescription, Sampler, SampleSta } class MockWebDriverAdapter extends WebDriverAdapter { - executeScript(script: string): Promise { + override executeScript(script: string): Promise { return Promise.resolve('someUserAgent'); } - capabilities(): Promise> { + override capabilities(): Promise> { return null!; } } @@ -118,7 +118,7 @@ class MockValidator extends Validator { constructor() { super(); } - describe() { + override describe() { return {'v': 11}; } } @@ -127,7 +127,7 @@ class MockMetric extends Metric { constructor() { super(); } - describe() { + override describe() { return {'m1': 'some metric'}; } } @@ -136,7 +136,7 @@ class MockSampler extends Sampler { constructor() { super(null!, null!, null!, null!, null!, null!, null!); } - sample(): Promise { + override sample(): Promise { return Promise.resolve(new SampleState([], [])); } } diff --git a/packages/benchpress/test/sampler_spec.ts b/packages/benchpress/test/sampler_spec.ts index 8ca4f2a067..c06e3a639f 100644 --- a/packages/benchpress/test/sampler_spec.ts +++ b/packages/benchpress/test/sampler_spec.ts @@ -225,7 +225,7 @@ class MockDriverAdapter extends WebDriverAdapter { constructor(private _log: any[] = [], private _waitFor: Function|null = null) { super(); } - waitFor(callback: Function): Promise { + override waitFor(callback: Function): Promise { if (this._waitFor != null) { return this._waitFor(callback); } else { @@ -239,7 +239,7 @@ class MockValidator extends Validator { constructor(private _log: any[] = [], private _validate: Function|null = null) { super(); } - validate(completeSample: MeasureValues[]): MeasureValues[] { + override validate(completeSample: MeasureValues[]): MeasureValues[] { const stableSample = this._validate != null ? this._validate(completeSample) : completeSample; this._log.push(['validate', completeSample, stableSample]); return stableSample; @@ -250,11 +250,11 @@ class MockMetric extends Metric { constructor(private _log: any[] = [], private _endMeasure: Function|null = null) { super(); } - beginMeasure() { + override beginMeasure() { this._log.push(['beginMeasure']); return Promise.resolve(null); } - endMeasure(restart: boolean) { + override endMeasure(restart: boolean) { const measureValues = this._endMeasure != null ? this._endMeasure() : {}; this._log.push(['endMeasure', restart, measureValues]); return Promise.resolve(measureValues); @@ -265,11 +265,12 @@ class MockReporter extends Reporter { constructor(private _log: any[] = []) { super(); } - reportMeasureValues(values: MeasureValues): Promise { + override reportMeasureValues(values: MeasureValues): Promise { this._log.push(['reportMeasureValues', values]); return Promise.resolve(null); } - reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): Promise { + override reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): + Promise { this._log.push(['reportSample', completeSample, validSample]); return Promise.resolve(null); } diff --git a/packages/benchpress/test/web_driver_extension_spec.ts b/packages/benchpress/test/web_driver_extension_spec.ts index 9303524c75..ccded7492a 100644 --- a/packages/benchpress/test/web_driver_extension_spec.ts +++ b/packages/benchpress/test/web_driver_extension_spec.ts @@ -47,7 +47,7 @@ class MockExtension extends WebDriverExtension { super(); } - supports(capabilities: {[key: string]: any}): boolean { + override supports(capabilities: {[key: string]: any}): boolean { return capabilities['browser'] === this.id; } } diff --git a/packages/benchpress/test/webdriver/chrome_driver_extension_spec.ts b/packages/benchpress/test/webdriver/chrome_driver_extension_spec.ts index f9da9e31e8..f40825fc13 100644 --- a/packages/benchpress/test/webdriver/chrome_driver_extension_spec.ts +++ b/packages/benchpress/test/webdriver/chrome_driver_extension_spec.ts @@ -384,12 +384,12 @@ class MockDriverAdapter extends WebDriverAdapter { super(); } - executeScript(script: string) { + override executeScript(script: string) { this._log.push(['executeScript', script]); return Promise.resolve(null); } - logs(type: string): Promise { + override logs(type: string): Promise { this._log.push(['logs', type]); if (type === 'performance') { return Promise.resolve(this._events.map( diff --git a/packages/benchpress/test/webdriver/ios_driver_extension_spec.ts b/packages/benchpress/test/webdriver/ios_driver_extension_spec.ts index 9d7b9c198b..806526b981 100644 --- a/packages/benchpress/test/webdriver/ios_driver_extension_spec.ts +++ b/packages/benchpress/test/webdriver/ios_driver_extension_spec.ts @@ -160,12 +160,12 @@ class MockDriverAdapter extends WebDriverAdapter { super(); } - executeScript(script: string) { + override executeScript(script: string) { this._log.push(['executeScript', script]); return Promise.resolve(null); } - logs(type: string): Promise { + override logs(type: string): Promise { this._log.push(['logs', type]); if (type === 'performance') { return Promise.resolve(this._perfRecords.map(function(record) {