Determine if the WM entry is complete or not

Use the same logic from CTS tests

Read the information from flickerlib and display in winscope

Test: yarn run dev and open a few WM traces
Bug: 167521440
Change-Id: I96cb956968066afaabb3acf53615db53bdfabe37
This commit is contained in:
Nataniel Borges
2020-10-23 14:22:19 +02:00
parent 5e4ca356ae
commit 9534747390
12 changed files with 82 additions and 48 deletions

View File

@@ -26,6 +26,21 @@ export const DiffType = Object.freeze({
MODIFIED: 'modified',
});
export function asRawTreeViewObject(obj) {
const children = obj.children?.map(child => child.rawTreeViewObject) ?? []
return {
kind: obj.kind,
name: obj.name,
shortName: obj.shortName,
stableId: obj.stableId,
chips: obj.chips,
obj: obj.obj,
children,
ref: obj,
};
}
export function defaultModifiedCheck(newNode, oldNode) {
if (!newNode && !oldNode) {
return false;
@@ -44,16 +59,16 @@ function isPrimitive(test) {
export class DiffGenerator {
constructor(tree) {
if (tree.asRawTreeViewObject) {
this.tree = tree.asRawTreeViewObject();
if (tree.rawTreeViewObject) {
this.tree = tree.rawTreeViewObject;
} else {
this.tree = tree;
}
}
compareWith(tree) {
if (tree?.asRawTreeViewObject) {
this.diffWithTree = tree.asRawTreeViewObject();
if (tree?.rawTreeViewObject) {
this.diffWithTree = tree.rawTreeViewObject;
} else {
this.diffWithTree = tree;
}