Definition at line 27 of file FlutterTextureViewTest.java.
◆ itShouldCreateANewSurfaceWhenReattachedAfterDetachingFromRenderer()
void io.flutter.embedding.android.FlutterTextureViewTest.itShouldCreateANewSurfaceWhenReattachedAfterDetachingFromRenderer |
( |
| ) |
|
|
inline |
Definition at line 43 of file FlutterTextureViewTest.java.
43 {
44
45
46
47
48
49
50
51
52
53
54
55 final FlutterTextureView textureView =
56 spy(new FlutterTextureView(ApplicationProvider.getApplicationContext()));
57
58 FlutterJNI fakeFlutterJNI = mock(FlutterJNI.class);
60
61 when(textureView.isSurfaceAvailableForRendering()).thenReturn(true);
62 when(textureView.getSurfaceTexture()).thenReturn(mock(SurfaceTexture.class));
63 when(textureView.getWindowToken()).thenReturn(mock(
android.os.IBinder.class));
64
65
66 textureView.attachToRenderer(flutterRenderer);
67
68
69 verify(fakeFlutterJNI,
times(1)).onSurfaceCreated(
any(Surface.class));
70
71
72 textureView.detachFromRenderer();
73
74
75 verify(fakeFlutterJNI,
times(1)).onSurfaceDestroyed();
76
77
78 textureView.attachToRenderer(flutterRenderer);
79
80
81 verify(fakeFlutterJNI, never()).onSurfaceWindowChanged(
any(Surface.class));
82 verify(fakeFlutterJNI,
times(2)).onSurfaceCreated(
any(Surface.class));
83 }
static SkISize times(const SkISize &size, float factor)
SIT bool any(const Vec< 1, T > &x)
◆ surfaceTextureListenerReleasesRenderer()
void io.flutter.embedding.android.FlutterTextureViewTest.surfaceTextureListenerReleasesRenderer |
( |
| ) |
|
|
inline |
Definition at line 29 of file FlutterTextureViewTest.java.
29 {
30 final FlutterTextureView textureView =
31 new FlutterTextureView(ApplicationProvider.getApplicationContext());
32 final Surface mockRenderSurface = mock(Surface.class);
33
34 textureView.setRenderSurface(mockRenderSurface);
35
36 final TextureView.SurfaceTextureListener listener = textureView.getSurfaceTextureListener();
37 listener.onSurfaceTextureDestroyed(mock(SurfaceTexture.class));
38
39 verify(mockRenderSurface).release();
40 }
The documentation for this class was generated from the following file: