mirror of
https://github.com/androidx/media.git
synced 2025-05-04 14:10:40 +08:00
Ignore decoding test cases when library not available
#minor-release PiperOrigin-RevId: 452043577 (cherry picked from commit c3866449e248bb7e7fce6c78b51f4960e14a0c91)
This commit is contained in:
parent
6e735ac297
commit
2b8dbb5143
@ -16,6 +16,7 @@
|
|||||||
package com.google.android.exoplayer2.ext.opus;
|
package com.google.android.exoplayer2.ext.opus;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
import static org.junit.Assume.assumeTrue;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
@ -26,7 +27,6 @@ import com.google.android.exoplayer2.util.LibraryLoader;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.ByteOrder;
|
import java.nio.ByteOrder;
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
@ -69,11 +69,6 @@ public final class OpusDecoderTest {
|
|||||||
private static final ImmutableList<byte[]> FULL_INITIALIZATION_DATA =
|
private static final ImmutableList<byte[]> FULL_INITIALIZATION_DATA =
|
||||||
ImmutableList.of(HEADER, CUSTOM_PRE_SKIP_BYTES, CUSTOM_SEEK_PRE_ROLL_BYTES);
|
ImmutableList.of(HEADER, CUSTOM_PRE_SKIP_BYTES, CUSTOM_SEEK_PRE_ROLL_BYTES);
|
||||||
|
|
||||||
@Before
|
|
||||||
public void setUp() {
|
|
||||||
assertThat(LOADER.isAvailable()).isTrue();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getChannelCount() {
|
public void getChannelCount() {
|
||||||
int channelCount = OpusDecoder.getChannelCount(HEADER);
|
int channelCount = OpusDecoder.getChannelCount(HEADER);
|
||||||
@ -120,6 +115,7 @@ public final class OpusDecoderTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void decode_removesPreSkipFromOutput() throws OpusDecoderException {
|
public void decode_removesPreSkipFromOutput() throws OpusDecoderException {
|
||||||
|
assumeTrue(LOADER.isAvailable());
|
||||||
OpusDecoder decoder =
|
OpusDecoder decoder =
|
||||||
new OpusDecoder(
|
new OpusDecoder(
|
||||||
/* numInputBuffers= */ 0,
|
/* numInputBuffers= */ 0,
|
||||||
@ -139,6 +135,7 @@ public final class OpusDecoderTest {
|
|||||||
@Test
|
@Test
|
||||||
public void decode_whenDiscardPaddingDisabled_returnsDiscardPadding()
|
public void decode_whenDiscardPaddingDisabled_returnsDiscardPadding()
|
||||||
throws OpusDecoderException {
|
throws OpusDecoderException {
|
||||||
|
assumeTrue(LOADER.isAvailable());
|
||||||
OpusDecoder decoder =
|
OpusDecoder decoder =
|
||||||
new OpusDecoder(
|
new OpusDecoder(
|
||||||
/* numInputBuffers= */ 0,
|
/* numInputBuffers= */ 0,
|
||||||
@ -159,6 +156,7 @@ public final class OpusDecoderTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void decode_whenDiscardPaddingEnabled_removesDiscardPadding() throws OpusDecoderException {
|
public void decode_whenDiscardPaddingEnabled_removesDiscardPadding() throws OpusDecoderException {
|
||||||
|
assumeTrue(LOADER.isAvailable());
|
||||||
OpusDecoder decoder =
|
OpusDecoder decoder =
|
||||||
new OpusDecoder(
|
new OpusDecoder(
|
||||||
/* numInputBuffers= */ 0,
|
/* numInputBuffers= */ 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user