use of org.robolectric.shadows.ShadowAccessibilityManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SettingsSliceProviderTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
// Register the fake a11y Service
ShadowAccessibilityManager shadowAccessibilityManager = Shadow.extract(RuntimeEnvironment.application.getSystemService(AccessibilityManager.class));
shadowAccessibilityManager.setInstalledAccessibilityServiceList(new ArrayList<>());
mProvider = spy(new SettingsSliceProvider());
ShadowStrictMode.reset();
mProvider.mSliceWeakDataCache = new HashMap<>();
mProvider.mSlicesDatabaseAccessor = new SlicesDatabaseAccessor(mContext);
when(mProvider.getContext()).thenReturn(mContext);
SlicesDatabaseHelper.getInstance(mContext).setIndexedState();
doReturn(mManager).when(mContext).getSystemService(SliceManager.class);
when(mManager.getPinnedSlices()).thenReturn(Collections.emptyList());
SliceProvider.setSpecs(SliceLiveData.SUPPORTED_SPECS);
}
use of org.robolectric.shadows.ShadowAccessibilityManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SlicesDatabaseAccessorTest method setUp.
@Before
public void setUp() {
mContext = RuntimeEnvironment.application;
ShadowUserManager.getShadow().setIsAdminUser(true);
mAccessor = spy(new SlicesDatabaseAccessor(mContext));
mDb = SlicesDatabaseHelper.getInstance(mContext).getWritableDatabase();
SlicesDatabaseHelper.getInstance(mContext).setIndexedState();
// Register the fake a11y Service
ShadowAccessibilityManager shadowAccessibilityManager = Shadow.extract(RuntimeEnvironment.application.getSystemService(AccessibilityManager.class));
shadowAccessibilityManager.setInstalledAccessibilityServiceList(new ArrayList<>());
}
Aggregations