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

Commit cfcfb024 authored by Goven Liu's avatar Goven Liu Committed by Android (Google) Code Review
Browse files

Merge "[Wi-Fi NetworkRequest] Set theme for the NetworkRequest dialog" into qt-qpr1-dev

parents 1dea0243 14a74125
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2707,7 +2707,7 @@

        <activity
            android:name=".wifi.NetworkRequestDialogActivity"
            android:theme="@style/Transparent"
            android:theme="@style/Theme.AlertDialog"
            android:excludeFromRecents="true"
            android:launchMode="singleTop"
            android:taskAffinity=".wifi.NetworkRequestDialogActivity"
+7 −3
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import com.android.settings.testutils.shadow.ShadowAlertDialogCompat;
import com.android.settingslib.wifi.WifiTracker;
import com.android.settingslib.wifi.WifiTrackerFactory;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
@@ -36,15 +37,18 @@ import org.robolectric.annotation.Config;
@Config(shadows = ShadowAlertDialogCompat.class)
public class NetworkRequestDialogActivityTest {

    @Test
    public void LaunchActivity_shouldShowNetworkRequestDialog() {
    @Before
    public void setUp() {
        // Mocks fake WifiTracker, in case of exception in NetworkRequestDialogFragment.onResume().
        WifiTracker wifiTracker = mock(WifiTracker.class);
        WifiTrackerFactory.setTestingWifiTracker(wifiTracker);
    }

    @Test
    public void launchActivity_shouldShowNetworkRequestDialog() {
        Robolectric.setupActivity(NetworkRequestDialogActivity.class);

        AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
        final AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();

        assertThat(alertDialog.isShowing()).isTrue();
    }