1import { getSimplifiedLayerName } from "../src/utils/names";
2
3const simplifications = {
4  "WindowToken{38eae45 android.os.BinderProxy@398bebc}#0": "WindowToken",
5  "7d8c460 NavigationBar0#0": "NavigationBar0#0",
6  "Surface(name=d2965b1 NavigationBar0)/@0xe4380b2 - animation-leash#2": "Surface - animation-leash#2",
7  "com.breel.wallpapers19.doodle.wallpaper.variations.DoodleWallpaperV1#0": "DoodleWallpaperV1#0",
8  "ActivityRecord{825ebe6 u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity#0": "ActivityRecord",
9  "com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity#0": "NexusLauncherActivity#0",
10  "com.android.settings/com.android.settings.Settings$UsbDetailsActivity#0": "Settings$UsbDetailsActivity#0",
11  "7d8c460 com.google.android.calendar/com.google.android.calendar.AllInOneCalendarActivity#0": "AllInOneCalendarActivity#0",
12  "WallpaperWindowToken{ad25afe token=android.os.Binder@8ab6b9}#0": "WallpaperWindowToken",
13};
14
15describe("getSimplifiedLayerName", () => {
16  it("simplifies traces as expected", () => {
17    for (const longName in simplifications) {
18      const expectedSimplifiedName = simplifications[longName];
19      const actualSimplifiedName = getSimplifiedLayerName(longName);
20
21      expect(actualSimplifiedName).toBe(expectedSimplifiedName);
22    }
23  });
24});