Merge "Generate real timestamp for WM dumps"
This commit is contained in:
committed by
Android (Google) Code Review
commit
5e6e22d2b4
@@ -48,10 +48,12 @@ class ParserWindowManagerDump extends Parser {
|
||||
}
|
||||
|
||||
override getTimestamp(type: TimestampType, entryProto: any): undefined | Timestamp {
|
||||
if (type !== TimestampType.ELAPSED) {
|
||||
return undefined;
|
||||
if (type === TimestampType.ELAPSED) {
|
||||
return new Timestamp(TimestampType.ELAPSED, 0n);
|
||||
} else if (type === TimestampType.REAL) {
|
||||
return new Timestamp(TimestampType.REAL, 0n);
|
||||
}
|
||||
return new Timestamp(TimestampType.ELAPSED, 0n);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
override processDecodedEntry(
|
||||
|
||||
@@ -35,8 +35,9 @@ describe('ParserWindowManagerDump', () => {
|
||||
expect(parser.getTimestamps(TimestampType.ELAPSED)).toEqual(expected);
|
||||
});
|
||||
|
||||
it("doesn't provide real timestamp (never)", () => {
|
||||
expect(parser.getTimestamps(TimestampType.REAL)).toEqual(undefined);
|
||||
it('provides real timestamp (always zero)', () => {
|
||||
const expected = [new Timestamp(TimestampType.REAL, 0n)];
|
||||
expect(parser.getTimestamps(TimestampType.REAL)).toEqual(expected);
|
||||
});
|
||||
|
||||
it('retrieves trace entry from elapsed timestamp', () => {
|
||||
|
||||
Reference in New Issue
Block a user