use of com.bumptech.glide.RequestManager in project glide by bumptech.
the class RequestManagerRetrieverTest method testApplicationRequestManagerIsNotPausedWhenRetrieved.
@Test
public void testApplicationRequestManagerIsNotPausedWhenRetrieved() {
RequestManager manager = retriever.get(RuntimeEnvironment.application);
assertFalse(manager.isPaused());
}
use of com.bumptech.glide.RequestManager in project glide by bumptech.
the class RequestManagerRetrieverTest method testHandlesContextWrappersForActivities.
@Test
public void testHandlesContextWrappersForActivities() {
RetrieverHarness harness = new DefaultRetrieverHarness();
RequestManager requestManager = harness.doGet();
ContextWrapper contextWrapper = new ContextWrapper(harness.getController().get());
assertEquals(requestManager, retriever.get(contextWrapper));
}
use of com.bumptech.glide.RequestManager in project glide by bumptech.
the class RequestManagerRetrieverTest method testChecksIfContextIsFragmentActivity.
@Test
public void testChecksIfContextIsFragmentActivity() {
RetrieverHarness harness = new SupportRetrieverHarness();
RequestManager requestManager = harness.doGet();
assertEquals(requestManager, retriever.get((Context) harness.getController().get()));
}
use of com.bumptech.glide.RequestManager in project glide by bumptech.
the class RequestManagerRetrieverTest method testSupportCanGetRequestManagerFromFragment.
@Test
public void testSupportCanGetRequestManagerFromFragment() {
FragmentActivity activity = Robolectric.buildActivity(FragmentActivity.class).create().start().resume().get();
Fragment fragment = new Fragment();
activity.getSupportFragmentManager().beginTransaction().add(fragment, PARENT_TAG).commit();
activity.getSupportFragmentManager().executePendingTransactions();
RequestManager manager = retriever.get(fragment);
assertEquals(manager, retriever.get(fragment));
}
use of com.bumptech.glide.RequestManager in project glide by bumptech.
the class RequestManagerRetrieverTest method testReturnsExistingRequestManagerIfExists.
@Test
public void testReturnsExistingRequestManagerIfExists() {
for (RetrieverHarness harness : harnesses) {
RequestManager requestManager = mock(RequestManager.class);
harness.addFragmentWithTag(RequestManagerRetriever.FRAGMENT_TAG, requestManager);
assertEquals(requestManager, harness.doGet());
}
}
Aggregations