1212import static org .mockito .Mockito .verify ;
1313import static org .mockito .Mockito .when ;
1414
15+ import android .annotation .SuppressLint ;
1516import android .annotation .TargetApi ;
1617import android .content .Context ;
1718import android .content .res .Configuration ;
@@ -579,6 +580,7 @@ public void flutterImageView_detachFromRendererClosesAllImages() {
579580 }
580581
581582 @ Test
583+ @ SuppressLint ("WrongCall" ) /*View#onDraw*/
582584 public void flutterImageView_onDrawClosesAllImages () {
583585 final ImageReader mockReader = mock (ImageReader .class );
584586 when (mockReader .getMaxImages ()).thenReturn (2 );
@@ -601,26 +603,27 @@ public void flutterImageView_onDrawClosesAllImages() {
601603 imageView .acquireLatestImage ();
602604 imageView .acquireLatestImage ();
603605
604- imageView .draw (mock (Canvas .class ));
605- imageView .draw (mock (Canvas .class ));
606+ imageView .onDraw (mock (Canvas .class ));
607+ imageView .onDraw (mock (Canvas .class ));
606608
607609 // 1 image is closed and 1 is active.
608610 verify (mockImage , times (1 )).close ();
609611 verify (mockReader , times (2 )).acquireLatestImage ();
610612
611613 // This call doesn't do anything because there isn't
612614 // an image in the queue.
613- imageView .draw (mock (Canvas .class ));
615+ imageView .onDraw (mock (Canvas .class ));
614616 verify (mockImage , times (1 )).close ();
615617
616618 // Aquire another image and push it to the queue.
617619 imageView .acquireLatestImage ();
618620 verify (mockReader , times (3 )).acquireLatestImage ();
619621
620622 // Then, the second image is closed.
621- imageView .draw (mock (Canvas .class ));
623+ imageView .onDraw (mock (Canvas .class ));
622624 verify (mockImage , times (2 )).close ();
623625 }
626+
624627 /*
625628 * A custom shadow that reports fullscreen flag for system UI visibility
626629 */
0 commit comments