From 58180a0f2ad94b3a1afa48ee80ac019c00adf9c6 Mon Sep 17 00:00:00 2001 From: Googler Date: Fri, 30 Jun 2023 15:35:20 +0000 Subject: [PATCH] Rename certain tests and modify documentation. PiperOrigin-RevId: 544664238 --- .../media3/exoplayer/ExoPlayerTest.java | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/ExoPlayerTest.java b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/ExoPlayerTest.java index 78eff1f235..9b93b8512d 100644 --- a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/ExoPlayerTest.java +++ b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/ExoPlayerTest.java @@ -13141,11 +13141,11 @@ public final class ExoPlayerTest { } /** - * Tests playback suppression for playback with only unsuitable route (e.g. builtin speaker) on - * Wear OS. + * Tests playback suppression for playback with only unsuitable outputs (e.g. builtin speaker) on + * the Wear OS. */ @Test - public void play_withNoSuitableMediaRouteOnWear_shouldSuppressPlayback() throws Exception { + public void play_withOnlyUnsuitableOutputsOnWear_shouldSuppressPlayback() throws Exception { addWatchAsSystemFeature(); setupConnectedAudioOutput(AudioDeviceInfo.TYPE_BUILTIN_SPEAKER); List playbackSuppressionList = new ArrayList<>(); @@ -13175,10 +13175,11 @@ public final class ExoPlayerTest { } /** - * Tests playback suppression for playback with suitable route (e.g. BluetoothA2DP) on Wear OS. + * Tests no playback suppression for playback with suitable output (e.g. BluetoothA2DP) on the + * Wear OS. */ @Test - public void play_withNoSuitableMediaRouteOnWear_shouldNotSuppressPlayback() throws Exception { + public void play_withAtleastOneSuitableOutputOnWear_shouldNotSuppressPlayback() throws Exception { addWatchAsSystemFeature(); setupConnectedAudioOutput( AudioDeviceInfo.TYPE_BUILTIN_SPEAKER, AudioDeviceInfo.TYPE_BLUETOOTH_A2DP); @@ -13208,12 +13209,12 @@ public final class ExoPlayerTest { } /** - * Tests playback suppression for multiple play calls with only unsuitable route (e.g. builtin - * speaker) on Wear OS. + * Tests same playback suppression reason for multiple play calls with only unsuitable output + * (e.g. builtin speaker) on the Wear OS. */ @Test public void - play_call2TimesWithSubsequentPauseWithNoSuitableRouteOnWear_shouldSuppressionPlayback2Times() + play_callMultipleTimesOnUnsuitableOutputFollowedByPause_shouldRetainSameSuppressionReason() throws Exception { addWatchAsSystemFeature(); setupConnectedAudioOutput(AudioDeviceInfo.TYPE_BUILTIN_SPEAKER); @@ -13249,7 +13250,7 @@ public final class ExoPlayerTest { /** Tests playback suppression for playback on the built-speaker on non-Wear OS surfaces. */ @Test - public void play_onBuiltinSpeakerWithoutWearSystemFeature_shouldNotSuppressPlayback() + public void play_onBuiltinSpeakerWithoutWearPresentAsSystemFeature_shouldNotSuppressPlayback() throws Exception { setupConnectedAudioOutput( AudioDeviceInfo.TYPE_BUILTIN_SPEAKER, AudioDeviceInfo.TYPE_BLUETOOTH_A2DP); @@ -13279,13 +13280,13 @@ public final class ExoPlayerTest { } /** - * Tests playback suppression for playback with only unsuitable route (e.g. builtin speaker) on - * Wear OS but {@link ExoPlayer.Builder#setSuppressPlaybackOnUnsuitableOutput(boolean)} is not - * called with parameter as TRUE. + * Tests playback suppression for playback with only unsuitable audio outputs (e.g. builtin + * speaker) on Wear OS but {@link + * ExoPlayer.Builder#setSuppressPlaybackOnUnsuitableOutput(boolean)} is not called with true. */ @Test public void - play_withOnlyUnsuitableRoutesWithoutEnablingPlaybackSuppression_shouldNotSuppressPlayback() + play_withOnlyUnsuitableOutputsWithoutEnablingPlaybackSuppression_shouldNotSuppressPlayback() throws Exception { addWatchAsSystemFeature(); setupConnectedAudioOutput(AudioDeviceInfo.TYPE_BUILTIN_SPEAKER); @@ -13315,10 +13316,11 @@ public final class ExoPlayerTest { /** * Tests removal of playback suppression reason as {@link - * Player#PLAYBACK_SUPPRESSION_REASON_UNSUITABLE_AUDIO_OUTPUT} when a suitable device is added. + * Player#PLAYBACK_SUPPRESSION_REASON_UNSUITABLE_AUDIO_OUTPUT} when a suitable audio output is + * added. */ @Test - public void addSuitableDevicesWhenPlaybackSuppressed_shouldRemovePlaybackSuppression() + public void addSuitableOutputWhenPlaybackSuppressed_shouldRemovePlaybackSuppression() throws Exception { addWatchAsSystemFeature(); setupConnectedAudioOutput(AudioDeviceInfo.TYPE_BUILTIN_SPEAKER); @@ -13352,11 +13354,11 @@ public final class ExoPlayerTest { } /** - * Tests no change in the playback suppression reason when an unsuitable device is connected while - * playback was suppressed earlier. + * Tests no change in the playback suppression reason when an unsuitable audio output is connected + * while playback was suppressed earlier. */ @Test - public void addUnsuitableDevicesWithPlaybackSuppressed_shouldNotRemovePlaybackSuppression() + public void addUnsuitableOutputWhenPlaybackIsSuppressed_shouldNotRemovePlaybackSuppression() throws Exception { addWatchAsSystemFeature(); setupConnectedAudioOutput(AudioDeviceInfo.TYPE_BUILTIN_SPEAKER); @@ -13386,11 +13388,11 @@ public final class ExoPlayerTest { } /** - * Tests no change in the playback suppression reason when a suitable device is added but playback - * was not suppressed earlier. + * Tests no change in the playback suppression reason when a suitable audio output is added but + * playback was not suppressed earlier. */ @Test - public void addSuitableDevicesWhenPlaybackNotSuppressed_shouldNotRemovePlaybackSuppression() + public void addSuitableOutputWhenPlaybackNotSuppressed_shouldNotRemovePlaybackSuppression() throws Exception { addWatchAsSystemFeature(); setupConnectedAudioOutput(AudioDeviceInfo.TYPE_BUILTIN_SPEAKER); @@ -13424,7 +13426,7 @@ public final class ExoPlayerTest { * have been removed during an ongoing playback. */ @Test - public void removeAllSuitableDevicesWhenPlaybackOngoing_shouldSetPlaybackSuppression() + public void removeAllSuitableOutputsWhenPlaybackOngoing_shouldSetPlaybackSuppression() throws Exception { addWatchAsSystemFeature(); setupConnectedAudioOutput( @@ -13456,10 +13458,10 @@ public final class ExoPlayerTest { /** * Tests no change in the playback suppression reason when any unsuitable audio outputs has been - * removed during an ongoing playback. + * removed during an ongoing playback but some suitable audio outputs are still available. */ @Test - public void removeAnyUnsuitableDevicesWhenPlaybackOngoing_shouldNotSetPlaybackSuppression() + public void removeAnyUnsuitableOutputWhenPlaybackOngoing_shouldNotSetPlaybackSuppression() throws Exception { addWatchAsSystemFeature(); setupConnectedAudioOutput( @@ -13494,12 +13496,12 @@ public final class ExoPlayerTest { /** * Tests no change in the playback suppression reason when any suitable audio outputs has been - * removed during an ongoing playback but at least one suitable audio output is still connected to - * the device. + * removed during an ongoing playback but at least one another suitable audio output is still + * connected to the device. */ @Test public void - removeAnySuitableDeviceButOneSuitableDeviceStillConnected_shouldNotSetPlaybackSuppression() + removeAnySuitableOutputButOneSuitableDeviceStillConnected_shouldNotSetPlaybackSuppression() throws Exception { addWatchAsSystemFeature(); setupConnectedAudioOutput(