mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 16:26:47 +00:00
Add debug logs for WorkTabExists test
Bug: 243688989 Change-Id: Iafec4cae86f1527acac9a25fceb501609ca308f6
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.launcher3.ui;
|
||||
import static com.android.launcher3.LauncherState.ALL_APPS;
|
||||
import static com.android.launcher3.LauncherState.NORMAL;
|
||||
import static com.android.launcher3.allapps.AllAppsStore.DEFER_UPDATES_TEST;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.WORK_TAB_MISSING;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@@ -65,8 +66,13 @@ public class WorkProfileTest extends AbstractLauncherUiTest {
|
||||
String[] tokens = output.split("\\s+");
|
||||
mProfileUserId = Integer.parseInt(tokens[tokens.length - 1]);
|
||||
output = mDevice.executeShellCommand("am start-user " + mProfileUserId);
|
||||
StringBuilder logStr = new StringBuilder().append("profileId: ").append(mProfileUserId);
|
||||
for (String str : tokens) {
|
||||
logStr.append(str).append("\n");
|
||||
}
|
||||
updateWorkProfileSetupSuccessful("am start-user", output);
|
||||
|
||||
Log.d(WORK_TAB_MISSING, "workProfileSuccessful? " + mWorkProfileSetupSuccessful);
|
||||
if (!mWorkProfileSetupSuccessful) {
|
||||
return; // no need to setup launcher since all tests will skip.
|
||||
}
|
||||
@@ -99,6 +105,7 @@ public class WorkProfileTest extends AbstractLauncherUiTest {
|
||||
private void waitForWorkTabSetup() {
|
||||
waitForLauncherCondition("Work tab not setup", launcher -> {
|
||||
if (launcher.getAppsView().getContentView() instanceof AllAppsPagedView) {
|
||||
Log.d(WORK_TAB_MISSING, "Deferring AppsStore updates");
|
||||
launcher.getAppsView().getAppsStore().enableDeferUpdates(DEFER_UPDATES_TEST);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user