@@ -498,61 +498,6 @@ public void onEndFrame__removesPlatformViewParent() {
498498 assertEquals (flutterView .getChildCount (), 1 );
499499 }
500500
501- @ Test
502- @ Config (shadows = {ShadowFlutterSurfaceView .class , ShadowFlutterJNI .class })
503- public void detach__destroysOverlaySurfaces () {
504- final PlatformViewsController platformViewsController = new PlatformViewsController ();
505-
506- final int platformViewId = 0 ;
507- assertNull (platformViewsController .getPlatformViewById (platformViewId ));
508-
509- final PlatformViewFactory viewFactory = mock (PlatformViewFactory .class );
510- final PlatformView platformView = mock (PlatformView .class );
511- when (platformView .getView ()).thenReturn (mock (View .class ));
512- when (viewFactory .create (any (), eq (platformViewId ), any ())).thenReturn (platformView );
513-
514- platformViewsController .getRegistry ().registerViewFactory ("testType" , viewFactory );
515-
516- final FlutterJNI jni = new FlutterJNI ();
517- jni .attachToNative (false );
518- attach (jni , platformViewsController );
519-
520- jni .onFirstFrame ();
521-
522- // Simulate create call from the framework.
523- createPlatformView (jni , platformViewsController , platformViewId , "testType" );
524-
525- // Produce a frame that displays a platform view and an overlay surface.
526- platformViewsController .onBeginFrame ();
527- platformViewsController .onDisplayPlatformView (
528- platformViewId ,
529- /* x=*/ 0 ,
530- /* y=*/ 0 ,
531- /* width=*/ 10 ,
532- /* height=*/ 10 ,
533- /* viewWidth=*/ 10 ,
534- /* viewHeight=*/ 10 ,
535- /* mutatorsStack=*/ new FlutterMutatorsStack ());
536-
537- final FlutterImageView overlayImageView = mock (FlutterImageView .class );
538- when (overlayImageView .acquireLatestImage ()).thenReturn (true );
539-
540- final FlutterOverlaySurface overlaySurface =
541- platformViewsController .createOverlaySurface (overlayImageView );
542- // This is OK.
543- platformViewsController .onDisplayOverlaySurface (
544- overlaySurface .getId (), /* x=*/ 0 , /* y=*/ 0 , /* width=*/ 10 , /* height=*/ 10 );
545-
546- platformViewsController .detach ();
547-
548- assertThrows (
549- IllegalStateException .class ,
550- () -> {
551- platformViewsController .onDisplayOverlaySurface (
552- overlaySurface .getId (), /* x=*/ 0 , /* y=*/ 0 , /* width=*/ 10 , /* height=*/ 10 );
553- });
554- }
555-
556501 @ Test
557502 public void checkInputConnectionProxy__falseIfViewIsNull () {
558503 final PlatformViewsController platformViewsController = new PlatformViewsController ();
0 commit comments