use of org.robolectric.shadows.ShadowUserManager in project android_packages_apps_Settings by crdroidandroid.
the class DevelopmentTilesTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mService = spy(Robolectric.setupService(DevelopmentTiles.ShowLayout.class));
final ShadowUserManager um = Shadows.shadowOf(RuntimeEnvironment.application.getSystemService(UserManager.class));
um.setIsAdminUser(true);
doReturn(mTile).when(mService).getQsTile();
}
use of org.robolectric.shadows.ShadowUserManager in project android_packages_apps_Settings by crdroidandroid.
the class RedactionInterstitialTest method managedProfileNoRestrictionsTest.
@Test
public void managedProfileNoRestrictionsTest() {
setupSettings(1, /* show */
1);
final ShadowUserManager sum = Shadow.extract(RuntimeEnvironment.application.getSystemService(UserManager.class));
sum.addProfile(UserHandle.myUserId(), UserHandle.myUserId(), "work-profile", /* profileName */
UserInfo.FLAG_MANAGED_PROFILE);
setupActivity();
assertHideAllVisible(false);
assertEnabledButtons(true, /* all */
true);
assertSelectedButton(R.id.show_all);
}
use of org.robolectric.shadows.ShadowUserManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class TopLevelNetworkEntryPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
final ShadowUserManager um = Shadows.shadowOf(RuntimeEnvironment.application.getSystemService(UserManager.class));
um.setIsAdminUser(true);
mController = new TopLevelNetworkEntryPreferenceController(mContext, "test_key");
ReflectionHelpers.setField(mController, "mWifiPreferenceController", mWifiPreferenceController);
ReflectionHelpers.setField(mController, "mMobileNetworkPreferenceController", mMobileNetworkPreferenceController);
ReflectionHelpers.setField(mController, "mTetherPreferenceController", mTetherPreferenceController);
}
use of org.robolectric.shadows.ShadowUserManager in project android_packages_apps_Settings by SudaMod.
the class DevelopmentTilesTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mService = spy(Robolectric.setupService(DevelopmentTiles.ShowLayout.class));
final ShadowUserManager um = Shadows.shadowOf(RuntimeEnvironment.application.getSystemService(UserManager.class));
um.setIsAdminUser(true);
doReturn(mTile).when(mService).getQsTile();
}
use of org.robolectric.shadows.ShadowUserManager in project android_packages_apps_Settings by SudaMod.
the class RedactionInterstitialTest method managedProfileNoRestrictionsTest.
@Test
public void managedProfileNoRestrictionsTest() {
setupSettings(1, /* show */
1);
final ShadowUserManager sum = Shadow.extract(RuntimeEnvironment.application.getSystemService(UserManager.class));
sum.setManagedProfile(true);
setupActivity();
assertHideAllVisible(false);
assertEnabledButtons(true, /* all */
true);
assertSelectedButton(R.id.show_all);
}
Aggregations