use of com.bumptech.glide.RequestManager in project glide by bumptech.
the class RequestManagerRetrieverTest method testChecksIfContextIsActivity.
@Test
public void testChecksIfContextIsActivity() {
RetrieverHarness harness = new DefaultRetrieverHarness();
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 testCanGetRequestManagerFromFragment.
@SuppressWarnings("deprecation")
@Test
public void testCanGetRequestManagerFromFragment() {
Activity activity = Robolectric.buildActivity(Activity.class).create().start().resume().get();
android.app.Fragment fragment = new android.app.Fragment();
activity.getFragmentManager().beginTransaction().add(fragment, PARENT_TAG).commit();
activity.getFragmentManager().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 testSupportCanGetRequestManagerFromActivity.
@Test
public void testSupportCanGetRequestManagerFromActivity() {
FragmentActivity fragmentActivity = Robolectric.buildActivity(FragmentActivity.class).create().start().get();
RequestManager manager = retriever.get(fragmentActivity);
assertEquals(manager, retriever.get(fragmentActivity));
}
use of com.bumptech.glide.RequestManager in project glide by bumptech.
the class RequestManagerRetrieverTest method testCanGetRequestManagerFromActivity.
@Test
public void testCanGetRequestManagerFromActivity() {
Activity activity = Robolectric.buildActivity(Activity.class).create().start().get();
RequestManager manager = retriever.get(activity);
assertEquals(manager, retriever.get(activity));
}
use of com.bumptech.glide.RequestManager in project glide by bumptech.
the class RequestManagerRetrieverTest method testSavesNewRequestManagerToFragmentIfCreatesRequestManagerForExistingFragment.
@Test
public void testSavesNewRequestManagerToFragmentIfCreatesRequestManagerForExistingFragment() {
for (RetrieverHarness harness : harnesses) {
harness.addFragmentWithTag(RequestManagerRetriever.FRAGMENT_TAG, null);
RequestManager first = harness.doGet();
RequestManager second = harness.doGet();
assertEquals(first, second);
}
}
Aggregations