File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
src/main/java/com/bumptech/glide
test/src/test/java/com/bumptech/glide Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -832,7 +832,7 @@ public <Y extends Target<TranscodeType>> Y experimentalIntoFront(@NonNull Y targ
832832 }
833833
834834 @ NonNull
835- <Y extends Target <TranscodeType >> Y into (
835+ public <Y extends Target <TranscodeType >> Y into (
836836 @ NonNull Y target ,
837837 @ Nullable RequestListener <TranscodeType > targetListener ,
838838 Executor callbackExecutor ) {
Original file line number Diff line number Diff line change 2828import com .bumptech .glide .tests .BackgroundUtil .BackgroundTester ;
2929import com .bumptech .glide .tests .TearDownGlide ;
3030import com .google .common .testing .EqualsTester ;
31+ import java .util .concurrent .Executors ;
3132import org .junit .Before ;
3233import org .junit .Rule ;
3334import org .junit .Test ;
@@ -89,6 +90,14 @@ public void testAddsNewRequestToRequestTracker() {
8990 verify (requestManager ).track (eq (target ), isA (Request .class ));
9091 }
9192
93+ @ Test
94+ public void testAddsNewRequestToRequestTrackerWithCustomExecutor () {
95+ getNullModelRequest ()
96+ .into (target , /* targetListener= */ null , Executors .newSingleThreadExecutor ());
97+
98+ verify (requestManager ).track (eq (target ), isA (Request .class ));
99+ }
100+
92101 @ Test
93102 public void testAddsNewRequestToRequestTrackerFront () {
94103 getNullModelRequest ().experimentalIntoFront (target );
@@ -186,6 +195,20 @@ public void runTest() {
186195 });
187196 }
188197
198+ @ Test
199+ public void doesNotThrowIfIntoTargetWithCustomExecutorCalledOnBackgroundThread ()
200+ throws InterruptedException {
201+ final Target <Object > target = mock (Target .class );
202+ testInBackground (
203+ new BackgroundTester () {
204+ @ Override
205+ public void runTest () {
206+ getNullModelRequest ()
207+ .into (target , /* targetListener= */ null , Executors .newSingleThreadExecutor ());
208+ }
209+ });
210+ }
211+
189212 @ Test
190213 public void testMultipleRequestListeners () {
191214 getNullModelRequest ().addListener (listener1 ).addListener (listener2 ).into (target );
You can’t perform that action at this time.
0 commit comments