Skip to content

Commit

Permalink
Make it easy to add trace categories on top of the default ones for C…
Browse files Browse the repository at this point in the history
…hrome. (#1090)
  • Loading branch information
soulgalore committed Jan 10, 2020
1 parent 1a01d4b commit 5beebfa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/chrome/webdriver/chromeDevtoolsProtocol.js
Expand Up @@ -34,8 +34,13 @@ class ChromeDevtoolsProtocol {
);
}

if (this.chrome.traceCategories) {
log.info('Use Chrome trace categories: %s', this.chrome.traceCategories);
if (this.chrome.traceCategory) {
const extraCategories = util.toArray(this.chrome.traceCategory);
Array.prototype.push.apply(this.chromeTraceCategories, extraCategories);
}

if (this.chrome.traceCategories || options.cpu) {
log.info('Use Chrome trace categories: %s', this.chromeTraceCategories);
}
}

Expand Down
6 changes: 6 additions & 0 deletions lib/support/cli.js
Expand Up @@ -183,6 +183,12 @@ module.exports.parseCommandLine = function parseCommandLine() {
type: 'string',
group: 'chrome'
})
.option('chrome.traceCategory', {
describe:
'Add a trace category to the default ones. Use --chrome.traceCategory multiple times if you want to add multiple categories',
type: 'string',
group: 'chrome'
})
.option('chrome.enableTraceScreenshots', {
alias: 'enableTraceScreenshots',
describe:
Expand Down

0 comments on commit 5beebfa

Please sign in to comment.