Revert "Test Fix SettingRobolectricTest Fail"

This reverts commit 818f77cd1f.

Reason for revert: Underlying issue fixed in ag/23454315.

Bug: b/275023433
Test: atest SettingsGlobalRoboTests

Change-Id: I1af272efd00b3c5bd35310512f5712d5d1c7d834
This commit is contained in:
Eric Rahm
2023-07-13 12:05:20 +00:00
parent 7cd9300c1d
commit 802b922593
142 changed files with 130 additions and 523 deletions

View File

@@ -28,8 +28,6 @@ import android.os.UserManager;
import androidx.test.core.app.ApplicationProvider;
import com.android.settings.utils.ActivityControllerWrapper;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -64,15 +62,14 @@ public class WifiDppConfiguratorActivityTest {
mIntent.putExtra(WifiDppUtils.EXTRA_WIFI_SECURITY, "WPA");
mIntent.putExtra(WifiDppUtils.EXTRA_WIFI_PRE_SHARED_KEY, "\\012345678,");
mActivity = spy((WifiDppConfiguratorActivity) ActivityControllerWrapper.setup(
Robolectric.buildActivity(WifiDppConfiguratorActivity.class)).get());
mActivity = spy(Robolectric.setupActivity(WifiDppConfiguratorActivity.class));
when(mActivity.getApplicationContext()).thenReturn(mContext);
}
@Test
public void launchActivity_noIntentAction_shouldNotFatalException() {
ActivityControllerWrapper.setup(
Robolectric.buildActivity(WifiDppConfiguratorActivity.class)).get();
WifiDppConfiguratorActivity wifiDppConfiguratorActivity =
Robolectric.setupActivity(WifiDppConfiguratorActivity.class);
}
@Test

View File

@@ -19,16 +19,15 @@ package com.android.settings.wifi.dpp;
import static com.android.settings.wifi.dpp.WifiDppEnrolleeActivity.ACTION_ENROLLEE_QR_CODE_SCANNER;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.content.Intent;
import com.android.settings.utils.ActivityControllerWrapper;
import com.android.settingslib.wifi.WifiRestrictionsCache;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -58,18 +57,16 @@ public class WifiDppEnrolleeActivityTest {
when(mIntent.getAction()).thenReturn(ACTION_ENROLLEE_QR_CODE_SCANNER);
when(mIntent.getStringExtra(WifiDppUtils.EXTRA_WIFI_SSID)).thenReturn(WIFI_SSID);
mActivity = (WifiDppEnrolleeActivity) ActivityControllerWrapper.setup(
Robolectric.buildActivity(WifiDppEnrolleeActivity.class)).get();
mActivity = spy(Robolectric.setupActivity(WifiDppEnrolleeActivity.class));
mActivity.mWifiRestrictionsCache = mWifiRestrictionsCache;
}
@Test
public void launchActivity_noIntentAction_shouldNotFatalException() {
ActivityControllerWrapper.setup(
Robolectric.buildActivity(WifiDppEnrolleeActivity.class)).get();
WifiDppEnrolleeActivity wifiDppEnrolleeActivity =
Robolectric.setupActivity(WifiDppEnrolleeActivity.class);
}
@Ignore
@Test
public void handleIntent_noIntentAction_shouldFinish() {
when(mIntent.getAction()).thenReturn(null);
@@ -79,7 +76,6 @@ public class WifiDppEnrolleeActivityTest {
verify(mActivity).finish();
}
@Ignore
@Test
public void handleIntent_notAllowedConfigWifi_shouldFinish() {
when(mWifiRestrictionsCache.isConfigWifiAllowed()).thenReturn(false);
@@ -89,7 +85,6 @@ public class WifiDppEnrolleeActivityTest {
verify(mActivity).finish();
}
@Ignore
@Test
public void handleIntent_hasIntentDataAndAllowedConfigWifi_shouldShowFragment() {
when(mWifiRestrictionsCache.isConfigWifiAllowed()).thenReturn(true);