Adding system health diags for inporoc tests

Bug: 133891845
Change-Id: I90161bfc9db5983a45dfb89728a82ec1e3d81f19
This commit is contained in:
vadimt
2019-06-27 19:16:38 -07:00
parent eb078ba5dd
commit 092b6f8cbf
4 changed files with 102 additions and 74 deletions

View File

@@ -51,6 +51,7 @@ import com.android.launcher3.compat.LauncherAppsCompat;
import com.android.launcher3.model.AppLaunchTracker;
import com.android.launcher3.tapl.LauncherInstrumentation;
import com.android.launcher3.tapl.TestHelpers;
import com.android.launcher3.testcomponent.TestCommandReceiver;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.Wait;
import com.android.launcher3.util.rule.FailureWatcher;
@@ -98,7 +99,11 @@ public abstract class AbstractLauncherUiTest {
} catch (RemoteException e) {
throw new RuntimeException(e);
}
if (TestHelpers.isInLauncherProcess()) Utilities.enableRunningInTestHarnessForTests();
if (TestHelpers.isInLauncherProcess()) {
Utilities.enableRunningInTestHarnessForTests();
mLauncher.setSystemHealthSupplier(() -> TestCommandReceiver.callCommand(
TestCommandReceiver.GET_SYSTEM_HEALTH_MESSAGE).getString("result"));
}
}
protected final LauncherActivityRule mActivityMonitor = new LauncherActivityRule();