fix(benchpress): support measuring scriptTime and other metrics of page reload.

E.g. for benchmarks that measure page start time
This commit is contained in:
Tobias Bosch
2016-09-15 08:51:55 -07:00
committed by Alex Eagle
parent c4114c2f66
commit 838d4bbf6c
6 changed files with 124 additions and 87 deletions

View File

@ -140,6 +140,8 @@ export class ChromeDriverExtension extends WebDriverExtension {
(!args || !args['data'] ||
(args['data']['scriptName'] !== 'InjectedScript' && args['data']['scriptName'] !== ''))) {
return normalizeEvent(event, {'name': 'script'});
} else if (this._isEvent(categories, name, ['devtools.timeline'], 'EvaluateScript')) {
return normalizeEvent(event, {'name': 'script'});
} else if (this._isEvent(
categories, name, ['devtools.timeline', 'blink'], 'UpdateLayoutTree')) {
return normalizeEvent(event, {'name': 'render'});
@ -187,6 +189,12 @@ function normalizeEvent(
ph = 'b';
} else if (ph === 'F') {
ph = 'e';
} else if (ph === 'R') {
// mark events from navigation timing
ph = 'I';
} else if (ph === 'i') {
// legacy support
ph = 'I';
}
var result: {[key: string]: any} =
{'pid': chromeEvent['pid'], 'ph': ph, 'cat': 'timeline', 'ts': chromeEvent['ts'] / 1000};