Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

Commit

Permalink
Rework test
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryQian committed Jul 11, 2020
1 parent 4707e91 commit 73ba72a
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,17 @@ public void itStopsSurfaceTextureCallbackWhenDetached() {
// Setup the test.
FlutterRenderer flutterRenderer = new FlutterRenderer(fakeFlutterJNI);

flutterRenderer.startRenderingToSurface(fakeSurface);
flutterRenderer.stopRenderingToSurface();
fakeFlutterJNI.detachFromNativeAndReleaseResources();

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()));
}
}

0 comments on commit 73ba72a

Please sign in to comment.