/** * @deprecated Use {@link #init(Context, GlideBuilder)} to get a singleton compatible with * Glide's generated API. * * <p>This method will be removed in a future version of Glide. */ @VisibleForTesting @Deprecated public static synchronized void init(Glide glide) { if (Glide.glide != null) { tearDown(); } Glide.glide = glide; }
@VisibleForTesting public static synchronized void init(@NonNull Context context, @NonNull GlideBuilder builder) { if (Glide.glide != null) { tearDown(); } initializeGlide(context, builder); }
@Override public void evaluate() throws Throwable { try { base.evaluate(); } finally { Glide.tearDown(); } } };
@After public void tearDown() { Glide.tearDown(); }
@After public void tearDown() { Glide.tearDown(); }
@After public void tearDown() { Glide.tearDown(); }
@After public void tearDown() { Glide.tearDown(); }
@After public void tearDown() { Glide.tearDown(); }
@After public void tearDown() { Glide.tearDown(); }
@After public void tearDown() { Glide.tearDown(); }
@After public void tearDown() { Glide.tearDown(); }
@After public void tearDown() { // Force us to wait until Glide's threads shut down. Glide.tearDown(); deleteRecursively(cacheDir); }
@After public void tearDown() { Glide.get(context).clearDiskCache(); Glide.tearDown(); }
@Override public void evaluate() throws Throwable { try { base.evaluate(); } finally { new ConcurrencyHelper().runOnMainThread(new Runnable() { @Override public void run() { RequestManager requestManager = Glide.with(InstrumentationRegistry.getTargetContext()); requestManager.onStop(); requestManager.onDestroy(); } }); Glide.tearDown(); } } };
@Test public void transform_withColorDrawable_andUnitBitmapTransformation_recycles() { bitmapPool = mock(BitmapPool.class); Glide.tearDown(); Glide.init(context, new GlideBuilder().setBitmapPool(bitmapPool)); when(
@Test public void clearRequest_withError_afterPrimaryFails_clearsErrorRequest() { WaitModel<Integer> errorModel = WaitModelLoader.Factory.waitOn(ResourceIds.raw.canonical); FutureTarget<Drawable> target = Glide.with(context) .load((Object) null) .error( Glide.with(context) .load(errorModel) .listener(requestListener)) .submit(); Glide.with(context).clear(target); errorModel.countDown(); // Make sure any pending requests run. concurrency.pokeMainThread(); Glide.tearDown(); // Make sure that any callbacks posted back to the main thread run. concurrency.pokeMainThread(); }