Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f092a9a authored by JW Wang's avatar JW Wang
Browse files

Code cleanup: StagedRollbackTest (5/n)

Rename and group device methods together that belong to the same host
side method.

Bug: 142697546
Test: atest StagedRollbackTest
Change-Id: Ib9ff6e4fb6b59e1fb5a3124569e7ec13b230fd86
parent 3574194d
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -292,6 +292,21 @@ public class StagedRollbackTest {
        Uninstall.packages(TestApp.A);
    }

    @Test
    public void testNetworkPassedDoesNotRollback_Phase1() throws Exception {
        resetNetworkStack();
    }

    @Test
    public void testNetworkPassedDoesNotRollback_Phase2() throws Exception {
        assertNetworkStackRollbackAvailable();
    }

    @Test
    public void testNetworkPassedDoesNotRollback_Phase3() throws Exception {
        assertNoNetworkStackRollbackCommitted();
    }

    @Nullable
    private static String getModuleMetadataPackageName() {
        String packageName = InstrumentationRegistry.getContext().getResources().getString(
+3 −3
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
    @Test
    public void testNetworkPassedDoesNotRollback() throws Exception {
        // Remove available rollbacks and uninstall NetworkStack on /data/
        runPhase("resetNetworkStack");
        runPhase("testNetworkPassedDoesNotRollback_Phase1");
        // Reduce health check deadline, here unlike the network failed case, we use
        // a longer deadline because joining a network can take a much longer time for
        // reasons external to the device than 'not joining'
@@ -183,7 +183,7 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
        getDevice().waitForDeviceAvailable();

        // Verify rollback was enabled
        runPhase("assertNetworkStackRollbackAvailable");
        runPhase("testNetworkPassedDoesNotRollback_Phase2");

        // Connect to internet so network health check passes
        getDevice().executeShellCommand("svc wifi enable");
@@ -196,7 +196,7 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
        // Sleep for > health check deadline
        Thread.sleep(310000);
        // Verify rollback was not executed after health check deadline
        runPhase("assertNoNetworkStackRollbackCommitted");
        runPhase("testNetworkPassedDoesNotRollback_Phase3");
    }

    /**