Skip to content

Commit 0653b82

Browse files
committed
fix(benchpress): fix benchpress overreporting in chrome45
closes angular#4011 Closes angular#4101
1 parent 77e8304 commit 0653b82

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

modules/benchpress/src/webdriver/chrome_driver_extension.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ export class ChromeDriverExtension extends WebDriverExtension {
183183
return normalizeEvent(event, {'name': 'gc', 'args': normArgs});
184184
} else if (this._isEvent(categories, name, ['devtools.timeline', 'v8'], 'FunctionCall') &&
185185
(isBlank(args) || isBlank(args['data']) ||
186-
!StringWrapper.equals(args['data']['scriptName'], 'InjectedScript'))) {
186+
(!StringWrapper.equals(args['data']['scriptName'], 'InjectedScript') &&
187+
!StringWrapper.equals(args['data']['scriptName'], '')))) {
187188
return normalizeEvent(event, {'name': 'script'});
188189
} else if (this._isEvent(categories, name, ['devtools.timeline', 'blink'],
189190
'UpdateLayoutTree')) {

modules/benchpress/test/webdriver/chrome_driver_extension_spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,17 @@ export function main() {
342342
});
343343
}));
344344

345+
it('should ignore FunctionCalls with empty scriptName',
346+
inject([AsyncTestCompleter], (async) => {
347+
createExtension(
348+
[chromeTimelineV8Events.start('FunctionCall', 0, {'data': {'scriptName': ''}})])
349+
.readPerfLog()
350+
.then((events) => {
351+
expect(events).toEqual([]);
352+
async.done();
353+
});
354+
}));
355+
345356

346357
});
347358

0 commit comments

Comments
 (0)