Skip to content

Commit 345ef58

Browse files
authored
Include which browser args/preferences/trace configuration where used… (#2259)
1 parent 8b2e65b commit 345ef58

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

lib/core/engine/index.js

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
addConnectivity,
1111
removeConnectivity
1212
} from '../../connectivity/index.js';
13-
import { logResultLogLine, getProperty } from '../../support/util.js';
13+
import { logResultLogLine, getProperty, toArray } from '../../support/util.js';
1414
import {
1515
getFullyLoaded,
1616
getMainDocumentTimings,
@@ -30,6 +30,8 @@ import {
3030
loadPageCompleteScript
3131
} from '../../support/engineUtils.js';
3232
import { getAvailablePort } from '../../support/getPort.js';
33+
import { traceCategories as defaultChromeTraceCategories } from '../../chrome/settings/traceCategories.js';
34+
3335
const log = getLogger('browsertime');
3436
const defaults = {
3537
scripts: [],
@@ -369,6 +371,43 @@ export class Engine {
369371
for (let result of totalResult) {
370372
result.info.browser.name = extras.har.log.browser.name;
371373
result.info.browser.version = extras.har.log.browser.version;
374+
if (options.browser === 'firefox' && options.firefox) {
375+
result.info.browser.args = options.firefox.args;
376+
if (options.firefox.geckoProfiler === true) {
377+
result.info.browser.geckProfilerFeatures =
378+
options.firefox.geckoProfilerParams.features;
379+
}
380+
result.info.browser.preference = options.firefox.preference;
381+
} else if (options.browser === 'chrome') {
382+
if (options.chrome) {
383+
result.info.browser.args = options.chrome.args;
384+
}
385+
if (
386+
options.chrome &&
387+
(options.cpu || options.chrome.timeline || options.chrome.trace)
388+
) {
389+
// get correct trace categories
390+
let chromeTraceCategories = options.chrome.traceCategories
391+
? options.chrome.traceCategories.split(',')
392+
: [...defaultChromeTraceCategories];
393+
394+
if (options.chrome.enableTraceScreenshots) {
395+
chromeTraceCategories.push(
396+
'disabled-by-default-devtools.screenshot'
397+
);
398+
}
399+
400+
if (options.chrome && options.chrome.traceCategory) {
401+
const extraCategories = toArray(options.chrome.traceCategory);
402+
Array.prototype.push.apply(
403+
chromeTraceCategories,
404+
extraCategories
405+
);
406+
}
407+
408+
result.info.browser.traceCategories = chromeTraceCategories;
409+
}
410+
}
372411
}
373412
} else if (options.browser === 'safari') {
374413
for (let result of totalResult) {

0 commit comments

Comments
 (0)