Loading services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java +8 −12 Original line number Diff line number Diff line Loading @@ -120,9 +120,6 @@ import java.util.function.BiConsumer; */ @SmallTest public class ShortcutManagerTest1 extends BaseShortcutManagerTest { private static final boolean SKIP_FOR_BUG_67325252 = true; /** * Test for the first launch path, no settings file available. */ Loading Loading @@ -724,10 +721,6 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { } public void testCleanupDanglingBitmaps() throws Exception { if (SKIP_FOR_BUG_67325252) { return; } assertBitmapDirectories(USER_0, EMPTY_STRINGS); assertBitmapDirectories(USER_10, EMPTY_STRINGS); Loading Loading @@ -786,6 +779,7 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { dumpsysOnLogcat(); mService.waitForBitmapSavesForTest(); // Check files and directories. // Package 3 has no bitmaps, so we don't create a directory. assertBitmapDirectories(USER_0, CALLING_PACKAGE_1, CALLING_PACKAGE_2); Loading Loading @@ -841,6 +835,7 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { makeFile(mService.getUserBitmapFilePath(USER_10), CALLING_PACKAGE_2, "3").createNewFile(); makeFile(mService.getUserBitmapFilePath(USER_10), CALLING_PACKAGE_2, "4").createNewFile(); mService.waitForBitmapSavesForTest(); assertBitmapDirectories(USER_0, CALLING_PACKAGE_1, CALLING_PACKAGE_2, CALLING_PACKAGE_3, "a.b.c", "d.e.f"); Loading @@ -855,6 +850,7 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { // The below check is the same as above, except this time USER_0 use the CALLING_PACKAGE_3 // directory. mService.waitForBitmapSavesForTest(); assertBitmapDirectories(USER_0, CALLING_PACKAGE_1, CALLING_PACKAGE_2, CALLING_PACKAGE_3); assertBitmapDirectories(USER_10, CALLING_PACKAGE_1, CALLING_PACKAGE_2); Loading Loading @@ -1133,13 +1129,13 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { .setIcon(Icon.createWithResource(getTestContext(), R.drawable.black_32x32)) .build() ))); mService.waitForBitmapSavesForTest(); assertWith(getCallerShortcuts()) .forShortcutWithId("s1", si -> { assertTrue(si.hasIconResource()); assertEquals(R.drawable.black_32x32, si.getIconResourceId()); }); mService.waitForBitmapSavesForTest(); // Set bitmap icon assertTrue(mManager.updateShortcuts(list( new ShortcutInfo.Builder(mClientContext, "s1") Loading @@ -1147,7 +1143,7 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { getTestContext().getResources(), R.drawable.black_64x64))) .build() ))); mService.waitForBitmapSavesForTest(); assertWith(getCallerShortcuts()) .forShortcutWithId("s1", si -> { assertTrue(si.hasIconFile()); Loading @@ -1167,7 +1163,7 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { getTestContext().getResources(), R.drawable.black_64x64))) .build() ))); mService.waitForBitmapSavesForTest(); assertWith(getCallerShortcuts()) .forShortcutWithId("s1", si -> { assertTrue(si.hasIconFile()); Loading @@ -1179,7 +1175,7 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { .setIcon(Icon.createWithResource(getTestContext(), R.drawable.black_32x32)) .build() ))); mService.waitForBitmapSavesForTest(); assertWith(getCallerShortcuts()) .forShortcutWithId("s1", si -> { assertTrue(si.hasIconResource()); Loading Loading
services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java +8 −12 Original line number Diff line number Diff line Loading @@ -120,9 +120,6 @@ import java.util.function.BiConsumer; */ @SmallTest public class ShortcutManagerTest1 extends BaseShortcutManagerTest { private static final boolean SKIP_FOR_BUG_67325252 = true; /** * Test for the first launch path, no settings file available. */ Loading Loading @@ -724,10 +721,6 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { } public void testCleanupDanglingBitmaps() throws Exception { if (SKIP_FOR_BUG_67325252) { return; } assertBitmapDirectories(USER_0, EMPTY_STRINGS); assertBitmapDirectories(USER_10, EMPTY_STRINGS); Loading Loading @@ -786,6 +779,7 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { dumpsysOnLogcat(); mService.waitForBitmapSavesForTest(); // Check files and directories. // Package 3 has no bitmaps, so we don't create a directory. assertBitmapDirectories(USER_0, CALLING_PACKAGE_1, CALLING_PACKAGE_2); Loading Loading @@ -841,6 +835,7 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { makeFile(mService.getUserBitmapFilePath(USER_10), CALLING_PACKAGE_2, "3").createNewFile(); makeFile(mService.getUserBitmapFilePath(USER_10), CALLING_PACKAGE_2, "4").createNewFile(); mService.waitForBitmapSavesForTest(); assertBitmapDirectories(USER_0, CALLING_PACKAGE_1, CALLING_PACKAGE_2, CALLING_PACKAGE_3, "a.b.c", "d.e.f"); Loading @@ -855,6 +850,7 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { // The below check is the same as above, except this time USER_0 use the CALLING_PACKAGE_3 // directory. mService.waitForBitmapSavesForTest(); assertBitmapDirectories(USER_0, CALLING_PACKAGE_1, CALLING_PACKAGE_2, CALLING_PACKAGE_3); assertBitmapDirectories(USER_10, CALLING_PACKAGE_1, CALLING_PACKAGE_2); Loading Loading @@ -1133,13 +1129,13 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { .setIcon(Icon.createWithResource(getTestContext(), R.drawable.black_32x32)) .build() ))); mService.waitForBitmapSavesForTest(); assertWith(getCallerShortcuts()) .forShortcutWithId("s1", si -> { assertTrue(si.hasIconResource()); assertEquals(R.drawable.black_32x32, si.getIconResourceId()); }); mService.waitForBitmapSavesForTest(); // Set bitmap icon assertTrue(mManager.updateShortcuts(list( new ShortcutInfo.Builder(mClientContext, "s1") Loading @@ -1147,7 +1143,7 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { getTestContext().getResources(), R.drawable.black_64x64))) .build() ))); mService.waitForBitmapSavesForTest(); assertWith(getCallerShortcuts()) .forShortcutWithId("s1", si -> { assertTrue(si.hasIconFile()); Loading @@ -1167,7 +1163,7 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { getTestContext().getResources(), R.drawable.black_64x64))) .build() ))); mService.waitForBitmapSavesForTest(); assertWith(getCallerShortcuts()) .forShortcutWithId("s1", si -> { assertTrue(si.hasIconFile()); Loading @@ -1179,7 +1175,7 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { .setIcon(Icon.createWithResource(getTestContext(), R.drawable.black_32x32)) .build() ))); mService.waitForBitmapSavesForTest(); assertWith(getCallerShortcuts()) .forShortcutWithId("s1", si -> { assertTrue(si.hasIconResource()); Loading