Skip to content

Commit d0ba80c

Browse files
[ci][video_player_android][camera_android_camerax] Manual roll and fix tests (#8391)
Manual roll to check that the test warning suppressions will fix roll. I forgot to update the tests in #8388
1 parent 11a9fa8 commit d0ba80c

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

.ci/flutter_master.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
29a6c648ca4d2b813a6787644fdfe20421a2570a
1+
4b23b8182888d5d94645d8f97cdcc79800e44a9a

packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/PreviewTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void createSurfaceProducer_setsExpectedSurfaceProducerCallback() {
128128
TextureRegistry.SurfaceProducer.Callback callback = callbackCaptor.getValue();
129129

130130
// Verify callback's onSurfaceDestroyed invalidates SurfaceRequest.
131-
callback.onSurfaceDestroyed();
131+
simulateSurfaceDestruction(callback);
132132
verify(mockSurfaceRequest).invalidate();
133133

134134
reset(mockSurfaceRequest);
@@ -262,4 +262,12 @@ public void setTargetRotation_makesCallToSetTargetRotation() {
262262

263263
verify(mockPreview).setTargetRotation(targetRotation);
264264
}
265+
266+
// TODO(bparrishMines): Replace with inline calls to onSurfaceCleanup once available on stable;
267+
// see https://github.com/flutter/flutter/issues/16125. This separate method only exists to scope
268+
// the suppression.
269+
@SuppressWarnings({"deprecation", "removal"})
270+
void simulateSurfaceDestruction(TextureRegistry.SurfaceProducer.Callback producerLifecycle) {
271+
producerLifecycle.onSurfaceDestroyed();
272+
}
265273
}

packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/VideoPlayerTest.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public void onSurfaceProducerDestroyedAndAvailableReleasesAndThenRecreatesAndRes
184184
when(mockExoPlayer.getPlaybackParameters()).thenReturn(new PlaybackParameters(2.5f));
185185

186186
TextureRegistry.SurfaceProducer.Callback producerLifecycle = callbackCaptor.getValue();
187-
producerLifecycle.onSurfaceDestroyed();
187+
simulateSurfaceDestruction(producerLifecycle);
188188

189189
verify(mockExoPlayer).release();
190190

@@ -206,7 +206,7 @@ public void onSurfaceProducerDestroyedDoesNotStopOrPauseVideo() {
206206

207207
verify(mockProducer).setCallback(callbackCaptor.capture());
208208
TextureRegistry.SurfaceProducer.Callback producerLifecycle = callbackCaptor.getValue();
209-
producerLifecycle.onSurfaceDestroyed();
209+
simulateSurfaceDestruction(producerLifecycle);
210210

211211
verify(mockExoPlayer, never()).stop();
212212
verify(mockExoPlayer, never()).pause();
@@ -256,7 +256,7 @@ public void onSurfaceAvailableDoesNotSendInitializeEventAgain() {
256256
TextureRegistry.SurfaceProducer.Callback producerLifecycle = callbackCaptor.getValue();
257257

258258
// Trigger destroyed/available.
259-
producerLifecycle.onSurfaceDestroyed();
259+
simulateSurfaceDestruction(producerLifecycle);
260260
producerLifecycle.onSurfaceAvailable();
261261

262262
// Initial listener, and the new one from the resume.
@@ -301,4 +301,12 @@ public void disposeReleasesExoPlayerBeforeTexture() {
301301
inOrder.verify(mockExoPlayer).release();
302302
inOrder.verify(mockProducer).release();
303303
}
304+
305+
// TODO(bparrishMines): Replace with inline calls to onSurfaceCleanup once available on stable;
306+
// see https://github.com/flutter/flutter/issues/16125. This separate method only exists to scope
307+
// the suppression.
308+
@SuppressWarnings({"deprecation", "removal"})
309+
void simulateSurfaceDestruction(TextureRegistry.SurfaceProducer.Callback producerLifecycle) {
310+
producerLifecycle.onSurfaceDestroyed();
311+
}
304312
}

0 commit comments

Comments
 (0)