summaryrefslogtreecommitdiffstats
path: root/tests/tapl/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tapl/com/android')
-rw-r--r--tests/tapl/com/android/launcher3/tapl/AllApps.java22
-rw-r--r--tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java6
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java
index d03035a87..21d763e30 100644
--- a/tests/tapl/com/android/launcher3/tapl/AllApps.java
+++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java
@@ -48,6 +48,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer {
"apps_list_view");
// Wait for the recycler to populate.
mLauncher.waitForObjectInContainer(appListRecycler, By.clazz(TextView.class));
+ verifyNotFrozen("All apps freeze flags upon opening all apps");
}
@Override
@@ -210,4 +211,25 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer {
verifyActiveContainer();
}
}
+
+ /**
+ * Freezes updating app list upon app install/uninstall/update.
+ */
+ public void freeze() {
+ mLauncher.getTestInfo(TestProtocol.REQUEST_FREEZE_APP_LIST);
+ }
+
+ /**
+ * Resumes updating app list upon app install/uninstall/update.
+ */
+ public void unfreeze() {
+ mLauncher.getTestInfo(TestProtocol.REQUEST_UNFREEZE_APP_LIST);
+ verifyNotFrozen("All apps freeze flags upon unfreezing");
+ }
+
+ private void verifyNotFrozen(String message) {
+ mLauncher.assertEquals(message, 0, mLauncher.getTestInfo(
+ TestProtocol.REQUEST_APP_LIST_FREEZE_FLAGS).
+ getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD));
+ }
}
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index e45fca8c0..8ebe52565 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -292,6 +292,12 @@ public final class LauncherInstrumentation {
}
}
+ void assertEquals(String message, long expected, long actual) {
+ if (expected != actual) {
+ fail(message + " expected: " + expected + " but was: " + actual);
+ }
+ }
+
void assertNotEquals(String message, int unexpected, int actual) {
if (unexpected == actual) {
failEquals(message, actual);