@vpalmisano/webrtcperf 4.1.5 → 4.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -110,7 +110,7 @@ export interface SessionParams {
110
110
  debuggingAddress: string;
111
111
  randomAudioPeriod: number;
112
112
  maxVideoDecoders: number;
113
- maxVideoDecodersAt: number;
113
+ maxVideoDecodersRange: string;
114
114
  incognito: boolean;
115
115
  serverPort: number;
116
116
  serverSecret: string;
@@ -174,7 +174,7 @@ export declare class Session extends EventEmitter {
174
174
  private readonly debuggingAddress;
175
175
  private readonly randomAudioPeriod;
176
176
  private readonly maxVideoDecoders;
177
- private readonly maxVideoDecodersAt;
177
+ private readonly maxVideoDecodersRange;
178
178
  private readonly incognito;
179
179
  private readonly serverPort;
180
180
  private readonly serverSecret;
@@ -243,7 +243,7 @@ export declare class Session extends EventEmitter {
243
243
  pageErrors: number;
244
244
  private screensharePage?;
245
245
  private static readonly jsonFetchCache;
246
- constructor({ chromiumUrl, chromiumPath, chromiumFieldTrials, windowWidth, windowHeight, deviceScaleFactor, display, url, urlQuery, customUrlHandler, customUrlHandlerFn, mediaPath, videoWidth, videoHeight, videoFramerate, useFakeMedia, enableGpu, enableBrowserLogging, startTimestamp, sessions, tabsPerSession, spawnPeriod, statsInterval, disabledVideoCodecs, localStorage, sessionStorage, clearCookies, scriptPath, showPageLog, pageLogFilter, pageLogPath, userAgent, id, throttleIndex, evaluateAfter, exposedFunctions, scriptParams, blockedUrls, extraHeaders, responseModifiers, downloadResponses, extraCSS, cookies, overridePermissions, hardwareConcurrency, debuggingPort, debuggingAddress, randomAudioPeriod, maxVideoDecoders, maxVideoDecodersAt, incognito, serverPort, serverSecret, serverUseHttps, emulateCpuThrottling, }: SessionParams);
246
+ constructor({ chromiumUrl, chromiumPath, chromiumFieldTrials, windowWidth, windowHeight, deviceScaleFactor, display, url, urlQuery, customUrlHandler, customUrlHandlerFn, mediaPath, videoWidth, videoHeight, videoFramerate, useFakeMedia, enableGpu, enableBrowserLogging, startTimestamp, sessions, tabsPerSession, spawnPeriod, statsInterval, disabledVideoCodecs, localStorage, sessionStorage, clearCookies, scriptPath, showPageLog, pageLogFilter, pageLogPath, userAgent, id, throttleIndex, evaluateAfter, exposedFunctions, scriptParams, blockedUrls, extraHeaders, responseModifiers, downloadResponses, extraCSS, cookies, overridePermissions, hardwareConcurrency, debuggingPort, debuggingAddress, randomAudioPeriod, maxVideoDecoders, maxVideoDecodersRange, incognito, serverPort, serverSecret, serverUseHttps, emulateCpuThrottling, }: SessionParams);
247
247
  /**
248
248
  * Returns the chromium browser launch args
249
249
  * @return the args list
@@ -84,7 +84,7 @@ class Session extends events_1.default {
84
84
  debuggingAddress;
85
85
  randomAudioPeriod;
86
86
  maxVideoDecoders;
87
- maxVideoDecodersAt;
87
+ maxVideoDecodersRange;
88
88
  incognito;
89
89
  serverPort;
90
90
  serverSecret;
@@ -151,7 +151,7 @@ class Session extends events_1.default {
151
151
  });
152
152
  constructor({ chromiumUrl, chromiumPath, chromiumFieldTrials, windowWidth, windowHeight, deviceScaleFactor, display,
153
153
  /* audioRedForOpus, */
154
- url, urlQuery, customUrlHandler, customUrlHandlerFn, mediaPath, videoWidth, videoHeight, videoFramerate, useFakeMedia, enableGpu, enableBrowserLogging, startTimestamp, sessions, tabsPerSession, spawnPeriod, statsInterval, disabledVideoCodecs, localStorage, sessionStorage, clearCookies, scriptPath, showPageLog, pageLogFilter, pageLogPath, userAgent, id, throttleIndex, evaluateAfter, exposedFunctions, scriptParams, blockedUrls, extraHeaders, responseModifiers, downloadResponses, extraCSS, cookies, overridePermissions, hardwareConcurrency, debuggingPort, debuggingAddress, randomAudioPeriod, maxVideoDecoders, maxVideoDecodersAt, incognito, serverPort, serverSecret, serverUseHttps, emulateCpuThrottling, }) {
154
+ url, urlQuery, customUrlHandler, customUrlHandlerFn, mediaPath, videoWidth, videoHeight, videoFramerate, useFakeMedia, enableGpu, enableBrowserLogging, startTimestamp, sessions, tabsPerSession, spawnPeriod, statsInterval, disabledVideoCodecs, localStorage, sessionStorage, clearCookies, scriptPath, showPageLog, pageLogFilter, pageLogPath, userAgent, id, throttleIndex, evaluateAfter, exposedFunctions, scriptParams, blockedUrls, extraHeaders, responseModifiers, downloadResponses, extraCSS, cookies, overridePermissions, hardwareConcurrency, debuggingPort, debuggingAddress, randomAudioPeriod, maxVideoDecoders, maxVideoDecodersRange, incognito, serverPort, serverSecret, serverUseHttps, emulateCpuThrottling, }) {
155
155
  super();
156
156
  log.debug('constructor', { id });
157
157
  this.id = id;
@@ -222,7 +222,7 @@ class Session extends events_1.default {
222
222
  this.userAgent = userAgent;
223
223
  this.randomAudioPeriod = randomAudioPeriod;
224
224
  this.maxVideoDecoders = maxVideoDecoders;
225
- this.maxVideoDecodersAt = maxVideoDecodersAt;
225
+ this.maxVideoDecodersRange = maxVideoDecodersRange;
226
226
  this.incognito = incognito;
227
227
  this.serverPort = serverPort;
228
228
  this.serverSecret = serverSecret;
@@ -268,8 +268,8 @@ class Session extends events_1.default {
268
268
  if (!Array.isArray(replacements)) {
269
269
  throw new Error(`responseModifiers replacements should be an array of { search, replace, body, headers } objects: ${replacements}`);
270
270
  }
271
- this.responseModifiers[url] = replacements.map(({ search, replace, file, headers }) => ({
272
- search: search ? new RegExp(search, 'g') : undefined,
271
+ this.responseModifiers[url] = replacements.map(({ search, regexp, replace, file, headers }) => ({
272
+ search: regexp ? new RegExp(regexp, 'g') : search,
273
273
  replace,
274
274
  file,
275
275
  headers,
@@ -348,7 +348,7 @@ class Session extends events_1.default {
348
348
  fieldTrials = 'WebRTC-RtcEventLogNewFormat/Disabled/' + fieldTrials;
349
349
  env.CHROME_LOG_FILE = path_1.default.resolve(pageLogDir, `chrome-${this.id}.log`);
350
350
  }
351
- if (this.maxVideoDecoders !== -1 && this.id >= this.maxVideoDecodersAt) {
351
+ if (this.maxVideoDecoders !== -1 && (0, utils_1.enabledForSession)(this.id, this.maxVideoDecodersRange)) {
352
352
  fieldTrials = `WebRTC-MaxVideoDecoders/${this.maxVideoDecoders}/` + fieldTrials;
353
353
  }
354
354
  if (fieldTrials.length) {