summaryrefslogtreecommitdiffstats
path: root/tests/DSUEndtoEndTest.java
diff options
context:
space:
mode:
authorYo Chiang <yochiang@google.com>2020-09-03 11:54:23 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-09-03 11:54:23 +0000
commitf465eb8c7bd7596566a885c747304f117d801afe (patch)
tree9c900f8a269b5b79b8f0637269bf8c4adeee0325 /tests/DSUEndtoEndTest.java
parent1274eb3d3ca9956a61bc31ce68f692e32b01c001 (diff)
parent331184f545bbcc129cb7ddc8563c996d4a755191 (diff)
downloadplatform_system_gsid-master.tar.gz
platform_system_gsid-master.tar.bz2
platform_system_gsid-master.zip
Remove LockScreenAutomation.apk am: 331184f545HEADmaster
Original change: https://android-review.googlesource.com/c/platform/system/gsid/+/1418189 Change-Id: I0606028813ea410264eadea6a0ce7115005e7dca
Diffstat (limited to 'tests/DSUEndtoEndTest.java')
-rw-r--r--tests/DSUEndtoEndTest.java34
1 files changed, 2 insertions, 32 deletions
diff --git a/tests/DSUEndtoEndTest.java b/tests/DSUEndtoEndTest.java
index 69d40ad..e717079 100644
--- a/tests/DSUEndtoEndTest.java
+++ b/tests/DSUEndtoEndTest.java
@@ -47,11 +47,6 @@ import java.util.concurrent.TimeUnit;
@RunWith(DeviceJUnit4ClassRunner.class)
public class DSUEndtoEndTest extends BaseHostJUnit4Test {
private static final long kDefaultUserdataSize = 4L * 1024 * 1024 * 1024;
- private static final String APK = "LockScreenAutomation.apk";
- private static final String PACKAGE = "com.google.android.lockscreenautomation";
- private static final String UI_AUTOMATOR_INSTRUMENTATION_RUNNER =
- "androidx.test.uiautomator.UiAutomatorInstrumentationTestRunner";
- private static final String CLASS = "LockScreenAutomation";
private static final String LPUNPACK_PATH = "bin/lpunpack";
private static final String SIMG2IMG_PATH = "bin/simg2img";
@@ -74,7 +69,6 @@ public class DSUEndtoEndTest extends BaseHostJUnit4Test {
@After
public void teardown() throws Exception {
- uninstallPackage(PACKAGE);
if (mUnsparseSystemImage != null) {
mUnsparseSystemImage.delete();
}
@@ -129,13 +123,6 @@ public class DSUEndtoEndTest extends BaseHostJUnit4Test {
expectGsiStatus("normal");
- installPackage(APK);
- String method = "setPin";
- String testClass = PACKAGE + "." + CLASS;
- String testMethod = testClass + "." + method;
- Assert.assertTrue(testMethod + " failed.",
- runDeviceTests(UI_AUTOMATOR_INSTRUMENTATION_RUNNER, PACKAGE, testClass, method));
-
// Sleep after installing to allow time for gsi_tool to reboot. This prevents a race between
// the device rebooting and waitForDeviceAvailable() returning.
getDevice().executeShellV2Command("gsi_tool install --userdata-size " + mUserdataSize +
@@ -145,7 +132,7 @@ public class DSUEndtoEndTest extends BaseHostJUnit4Test {
expectGsiStatus("running");
- rebootAndUnlock();
+ getDevice().rebootUntilOnline();
expectGsiStatus("installed");
@@ -162,16 +149,10 @@ public class DSUEndtoEndTest extends BaseHostJUnit4Test {
getDevice().executeShellV2Command("gsi_tool wipe");
- rebootAndUnlock();
+ getDevice().rebootUntilOnline();
expectGsiStatus("normal");
- method = "removePin";
- testClass = PACKAGE + "." + CLASS;
- testMethod = testClass + "." + method;
- Assert.assertTrue(testMethod + " failed.",
- runDeviceTests(UI_AUTOMATOR_INSTRUMENTATION_RUNNER, PACKAGE, testClass, method));
-
if (wasRoot) {
getDevice().enableAdbRoot();
}
@@ -182,16 +163,5 @@ public class DSUEndtoEndTest extends BaseHostJUnit4Test {
String status = result.getStdout().split("\n", 2)[0].trim();
Assert.assertEquals("Device not in expected DSU state", expected, status);
}
-
- private void rebootAndUnlock() throws Exception {
- getDevice().rebootUntilOnline();
- getDevice().executeShellV2Command("input keyevent 224"); // KeyEvent.KEYCODE_WAKEUP
- getDevice().executeShellV2Command("wm dismiss-keyguard");
- getDevice().executeShellV2Command("input keyevent 7"); // KeyEvent.KEYCODE_0
- getDevice().executeShellV2Command("input keyevent 7");
- getDevice().executeShellV2Command("input keyevent 7");
- getDevice().executeShellV2Command("input keyevent 7");
- getDevice().executeShellV2Command("input keyevent 66"); // KeyEvent.KEYCODE_ENTER
- }
}