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

Commit eead2d6b authored by Song Chun Fan's avatar Song Chun Fan Committed by Android Build Coastguard Worker
Browse files

[ADI][unit test] Use `mUserId` instead of hardcoded 0 in `DeveloperVerifierControllerTest`.

The test calls to `startVerificationSession` now pass the `mUserId` member variable instead of a literal `0`, improving test clarity and correctness especially on Auto builds.

BUG: 441284150
FIXES: 441284150
FLAG: android.content.pm.verification_service
Test: presubmit
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:2bf5057878f1d1497ff0edf9e952d0bab4bee724
Merged-In: If97da86fae10075c5a3ea60413e630faea078cdb
Change-Id: If97da86fae10075c5a3ea60413e630faea078cdb
parent 375df252
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -312,7 +312,7 @@ public class DeveloperVerifierControllerTest {
        ArgumentCaptor<DeveloperVerificationSession> captor =
                ArgumentCaptor.forClass(DeveloperVerificationSession.class);
        assertThat(mDeveloperVerifierController.startVerificationSession(
                mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
                mSnapshotSupplier, mUserId, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
                TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
                mSessionCallback, mOnConnectionEstablished, /* retry= */ true)).isTrue();
        // Test the auto-disconnect job is canceled when the request is sent out
@@ -389,7 +389,7 @@ public class DeveloperVerifierControllerTest {
                        })
                .thenAnswer(i -> true);
        assertThat(mDeveloperVerifierController.startVerificationSession(
                mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
                mSnapshotSupplier, mUserId, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
                TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
                mSessionCallback, mOnConnectionEstablished, /* retry= */ false)).isTrue();
        verify(mHandler, times(1)).sendMessageAtTime(
@@ -401,7 +401,7 @@ public class DeveloperVerifierControllerTest {
        ArgumentCaptor<DeveloperVerificationSession> captor =
                ArgumentCaptor.forClass(DeveloperVerificationSession.class);
        assertThat(mDeveloperVerifierController.startVerificationSession(
                mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
                mSnapshotSupplier, mUserId, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
                TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
                mSessionCallback, mOnConnectionEstablished, /* retry= */ true)).isTrue();
        verify(mMockService).onVerificationRetry(captor.capture());