Skip to content

Commit

Permalink
[ci][video_player_android][camera_android_camerax] Manual roll and fi…
Browse files Browse the repository at this point in the history
…x tests (#8391)

Manual roll to check that the test warning suppressions will fix roll.

I forgot to update the tests in #8388
  • Loading branch information
bparrishMines authored Jan 8, 2025
1 parent 11a9fa8 commit d0ba80c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .ci/flutter_master.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
29a6c648ca4d2b813a6787644fdfe20421a2570a
4b23b8182888d5d94645d8f97cdcc79800e44a9a
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void createSurfaceProducer_setsExpectedSurfaceProducerCallback() {
TextureRegistry.SurfaceProducer.Callback callback = callbackCaptor.getValue();

// Verify callback's onSurfaceDestroyed invalidates SurfaceRequest.
callback.onSurfaceDestroyed();
simulateSurfaceDestruction(callback);
verify(mockSurfaceRequest).invalidate();

reset(mockSurfaceRequest);
Expand Down Expand Up @@ -262,4 +262,12 @@ public void setTargetRotation_makesCallToSetTargetRotation() {

verify(mockPreview).setTargetRotation(targetRotation);
}

// TODO(bparrishMines): Replace with inline calls to onSurfaceCleanup once available on stable;
// see https://github.com/flutter/flutter/issues/16125. This separate method only exists to scope
// the suppression.
@SuppressWarnings({"deprecation", "removal"})
void simulateSurfaceDestruction(TextureRegistry.SurfaceProducer.Callback producerLifecycle) {
producerLifecycle.onSurfaceDestroyed();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public void onSurfaceProducerDestroyedAndAvailableReleasesAndThenRecreatesAndRes
when(mockExoPlayer.getPlaybackParameters()).thenReturn(new PlaybackParameters(2.5f));

TextureRegistry.SurfaceProducer.Callback producerLifecycle = callbackCaptor.getValue();
producerLifecycle.onSurfaceDestroyed();
simulateSurfaceDestruction(producerLifecycle);

verify(mockExoPlayer).release();

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

verify(mockProducer).setCallback(callbackCaptor.capture());
TextureRegistry.SurfaceProducer.Callback producerLifecycle = callbackCaptor.getValue();
producerLifecycle.onSurfaceDestroyed();
simulateSurfaceDestruction(producerLifecycle);

verify(mockExoPlayer, never()).stop();
verify(mockExoPlayer, never()).pause();
Expand Down Expand Up @@ -256,7 +256,7 @@ public void onSurfaceAvailableDoesNotSendInitializeEventAgain() {
TextureRegistry.SurfaceProducer.Callback producerLifecycle = callbackCaptor.getValue();

// Trigger destroyed/available.
producerLifecycle.onSurfaceDestroyed();
simulateSurfaceDestruction(producerLifecycle);
producerLifecycle.onSurfaceAvailable();

// Initial listener, and the new one from the resume.
Expand Down Expand Up @@ -301,4 +301,12 @@ public void disposeReleasesExoPlayerBeforeTexture() {
inOrder.verify(mockExoPlayer).release();
inOrder.verify(mockProducer).release();
}

// TODO(bparrishMines): Replace with inline calls to onSurfaceCleanup once available on stable;
// see https://github.com/flutter/flutter/issues/16125. This separate method only exists to scope
// the suppression.
@SuppressWarnings({"deprecation", "removal"})
void simulateSurfaceDestruction(TextureRegistry.SurfaceProducer.Callback producerLifecycle) {
producerLifecycle.onSurfaceDestroyed();
}
}

0 comments on commit d0ba80c

Please sign in to comment.