Test Fix SettingRobolectricTest Fail

Bug: b/275023433
Test: NA
Change-Id: If2dcb8f6c196327129ccc9375b190e394c994efa
This commit is contained in:
Vincent Wang
2023-05-03 14:31:15 +00:00
parent cf440dcae5
commit 818f77cd1f
149 changed files with 552 additions and 131 deletions

View File

@@ -41,6 +41,7 @@ import com.android.settings.core.BasePreferenceController;
import com.android.settings.testutils.shadow.ShadowAccountManager;
import com.android.settings.testutils.shadow.ShadowContentResolver;
import com.android.settings.testutils.shadow.ShadowRestrictedLockUtilsInternal;
import com.android.settings.utils.ActivityControllerWrapper;
import org.junit.After;
import org.junit.Before;
@@ -68,7 +69,8 @@ public class ChooseAccountPreferenceControllerTest {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mController = spy(new ChooseAccountPreferenceController(mContext, "controller_key"));
mActivity = Robolectric.setupActivity(FragmentActivity.class);
mActivity = (FragmentActivity) ActivityControllerWrapper.setup(
Robolectric.buildActivity(FragmentActivity.class)).get();
mPreferenceManager = new PreferenceManager(mContext);
mPreferenceScreen = mPreferenceManager.createPreferenceScreen(mContext);
}