diff --git a/shell/platform/android/test/io/flutter/embedding/engine/renderer/FlutterRendererTest.java b/shell/platform/android/test/io/flutter/embedding/engine/renderer/FlutterRendererTest.java index 75a9f87ecbe8f..5e8ba3ffc2c93 100644 --- a/shell/platform/android/test/io/flutter/embedding/engine/renderer/FlutterRendererTest.java +++ b/shell/platform/android/test/io/flutter/embedding/engine/renderer/FlutterRendererTest.java @@ -103,16 +103,16 @@ public void itStopsSurfaceTextureCallbackWhenDetached() { // Setup the test. FlutterRenderer flutterRenderer = new FlutterRenderer(fakeFlutterJNI); - flutterRenderer.startRenderingToSurface(fakeSurface); - flutterRenderer.stopRenderingToSurface(); - fakeFlutterJNI.detachFromNativeAndReleaseResources(); + FlutterRenderer.SurfaceTextureRegistryEntry entry = (FlutterRenderer.SurfaceTextureRegistryEntry)flutterRenderer.createSurfaceTexture(); + flutterRenderer.startRenderingToSurface(fakeSurface); + // Execute the behavior under test. flutterRenderer.stopRenderingToSurface(); // Verify behavior under test. - verify(fakeFlutterJNI, times(1)).markTextureFrameAvailable(); + verify(fakeFlutterJNI, times(0)).markTextureFrameAvailable(eq(entry.id())); } }