fix(benchpress): support `tdur` in events
This commit is contained in:
parent
cde8ffd6d9
commit
b0c6db1efb
|
@ -116,7 +116,11 @@ function normalizeEvent(chromeEvent, data) {
|
||||||
'ts': chromeEvent['ts'] / 1000
|
'ts': chromeEvent['ts'] / 1000
|
||||||
};
|
};
|
||||||
if (chromeEvent['ph'] === 'X') {
|
if (chromeEvent['ph'] === 'X') {
|
||||||
result['dur'] = chromeEvent['dur'] / 1000;
|
var dur = chromeEvent['dur'];
|
||||||
|
if (isBlank(dur)) {
|
||||||
|
dur = chromeEvent['tdur'];
|
||||||
|
}
|
||||||
|
result['dur'] = isBlank(dur) ? 0.0 : dur / 1000;
|
||||||
}
|
}
|
||||||
StringMapWrapper.forEach(data, (value, prop) => {
|
StringMapWrapper.forEach(data, (value, prop) => {
|
||||||
result[prop] = value;
|
result[prop] = value;
|
||||||
|
|
|
@ -83,6 +83,17 @@ export function main() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should normalize "tdur" to "dur"', (done) => {
|
||||||
|
var event = chromeTimelineEvents.create('X', 'FunctionCall', 1100, null);
|
||||||
|
event['tdur'] = 5500;
|
||||||
|
createExtension([event]).readPerfLog().then( (events) => {
|
||||||
|
expect(events).toEqual([
|
||||||
|
normEvents.complete('script', 1.1, 5.5, null),
|
||||||
|
]);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('should report FunctionCall events as "script"', (done) => {
|
it('should report FunctionCall events as "script"', (done) => {
|
||||||
createExtension([
|
createExtension([
|
||||||
chromeTimelineEvents.start('FunctionCall', 0)
|
chromeTimelineEvents.start('FunctionCall', 0)
|
||||||
|
|
Loading…
Reference in New Issue