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

Commit f560cfa2 authored by Weng Su's avatar Weng Su
Browse files

Fix ConnectivityPreferenceControllerTest failures

- Security team add new parameter to registerReceiver() for security
design.

- Update the test case with the new parameters added.

Bug: 215311415
Test: manual test
make RunSettingsLibRoboTests
ROBOTEST_FILTER=ConnectivityPreferenceControllerTest

Change-Id: If68a5faf08b938b9b7ea26389d84b04e915f8811
parent 73df1b4d
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.settingslib.deviceinfo;

import static com.google.common.truth.Truth.assertWithMessage;

import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Mockito.doReturn;
@@ -33,7 +34,6 @@ import android.os.Handler;
import com.android.settingslib.core.lifecycle.Lifecycle;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
@@ -55,7 +55,6 @@ public class ConnectivityPreferenceControllerTest {
    }

    @Test
    @Ignore
    public void testBroadcastReceiver() {
        final AbstractConnectivityPreferenceController preferenceController =
                spy(new ConcreteConnectivityPreferenceController(mContext, mLifecycle));
@@ -73,7 +72,7 @@ public class ConnectivityPreferenceControllerTest {
        verify(mContext, times(1))
                .registerReceiver(receiverArgumentCaptor.capture(),
                        filterArgumentCaptor.capture(),
                        anyString(), nullable(Handler.class));
                        anyString(), nullable(Handler.class), anyInt());

        final BroadcastReceiver receiver = receiverArgumentCaptor.getValue();
        final IntentFilter filter = filterArgumentCaptor.getValue();