refactor(dev-infra): simplify runBenchmark (#38941)

* Make url and params optional in runBenchmark
* Make url optional in openBrowser
* Remove unused code from runBenchmark

PR Close #38941
This commit is contained in:
Wagner Maciel 2020-09-22 10:27:18 -07:00 committed by Misko Hevery
parent 75610505c6
commit b1682526dd
2 changed files with 3 additions and 5 deletions

View File

@ -13,7 +13,7 @@ import * as webdriver from 'selenium-webdriver';
declare var expect: any;
export function openBrowser(config: {
url: string,
url?: string,
params?: {name: string, value: any}[],
ignoreBrowserSynchronization?: boolean
}) {

View File

@ -34,8 +34,8 @@ export async function runBenchmark({
setup,
}: {
id: string,
url: string,
params: {name: string, value: any}[],
url?: string,
params?: {name: string, value: any}[],
ignoreBrowserSynchronization?: boolean,
microMetrics?: {[key: string]: string},
work?: (() => void)|(() => Promise<unknown>),
@ -46,8 +46,6 @@ export async function runBenchmark({
if (setup) {
await setup();
}
const description: {[key: string]: any} = {};
params.forEach((param) => description[param.name] = param.value);
return runner.sample({
id,
execute: work,