mirror of
https://github.com/androidx/media.git
synced 2025-05-04 06:00:37 +08:00
Move all tests to JUnit 4
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=209412403
This commit is contained in:
parent
05dcf502e5
commit
5c2dd9ca42
@ -27,6 +27,7 @@ android {
|
||||
minSdkVersion project.ext.minSdkVersion
|
||||
targetSdkVersion project.ext.targetSdkVersion
|
||||
consumerProguardFiles 'proguard-rules.txt'
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
}
|
||||
|
||||
sourceSets.main {
|
||||
@ -38,6 +39,7 @@ android {
|
||||
dependencies {
|
||||
implementation 'com.android.support:support-annotations:' + supportLibraryVersion
|
||||
implementation project(modulePrefix + 'library-core')
|
||||
androidTestImplementation 'androidx.test:runner:' + testRunnerVersion
|
||||
androidTestImplementation project(modulePrefix + 'testutils')
|
||||
testImplementation project(modulePrefix + 'testutils-robolectric')
|
||||
}
|
||||
|
@ -26,6 +26,6 @@
|
||||
|
||||
<instrumentation
|
||||
android:targetPackage="com.google.android.exoplayer2.ext.flac.test"
|
||||
android:name="android.test.InstrumentationTestRunner"/>
|
||||
android:name="androidx.test.runner.AndroidJUnitRunner"/>
|
||||
|
||||
</manifest>
|
||||
|
@ -15,10 +15,13 @@
|
||||
*/
|
||||
package com.google.android.exoplayer2.ext.flac;
|
||||
|
||||
import static androidx.test.InstrumentationRegistry.getContext;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Looper;
|
||||
import android.test.InstrumentationTestCase;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||
import com.google.android.exoplayer2.ExoPlayer;
|
||||
import com.google.android.exoplayer2.ExoPlayerFactory;
|
||||
@ -29,29 +32,31 @@ import com.google.android.exoplayer2.source.ExtractorMediaSource;
|
||||
import com.google.android.exoplayer2.source.MediaSource;
|
||||
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Playback tests using {@link LibflacAudioRenderer}.
|
||||
*/
|
||||
public class FlacPlaybackTest extends InstrumentationTestCase {
|
||||
/** Playback tests using {@link LibflacAudioRenderer}. */
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class FlacPlaybackTest {
|
||||
|
||||
private static final String BEAR_FLAC_URI = "asset:///bear-flac.mka";
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
@Before
|
||||
public void setUp() {
|
||||
if (!FlacLibrary.isAvailable()) {
|
||||
fail("Flac library not available.");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBasicPlayback() throws ExoPlaybackException {
|
||||
playUri(BEAR_FLAC_URI);
|
||||
}
|
||||
|
||||
private void playUri(String uri) throws ExoPlaybackException {
|
||||
TestPlaybackRunnable testPlaybackRunnable = new TestPlaybackRunnable(Uri.parse(uri),
|
||||
getInstrumentation().getContext());
|
||||
TestPlaybackRunnable testPlaybackRunnable =
|
||||
new TestPlaybackRunnable(Uri.parse(uri), getContext());
|
||||
Thread thread = new Thread(testPlaybackRunnable);
|
||||
thread.start();
|
||||
try {
|
||||
|
@ -27,6 +27,7 @@ android {
|
||||
minSdkVersion project.ext.minSdkVersion
|
||||
targetSdkVersion project.ext.targetSdkVersion
|
||||
consumerProguardFiles 'proguard-rules.txt'
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
}
|
||||
|
||||
sourceSets.main {
|
||||
@ -37,6 +38,7 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation project(modulePrefix + 'library-core')
|
||||
androidTestImplementation 'androidx.test:runner:' + testRunnerVersion
|
||||
}
|
||||
|
||||
ext {
|
||||
|
@ -26,6 +26,6 @@
|
||||
|
||||
<instrumentation
|
||||
android:targetPackage="com.google.android.exoplayer2.ext.opus.test"
|
||||
android:name="android.test.InstrumentationTestRunner"/>
|
||||
android:name="androidx.test.runner.AndroidJUnitRunner"/>
|
||||
|
||||
</manifest>
|
||||
|
@ -15,10 +15,13 @@
|
||||
*/
|
||||
package com.google.android.exoplayer2.ext.opus;
|
||||
|
||||
import static androidx.test.InstrumentationRegistry.getContext;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Looper;
|
||||
import android.test.InstrumentationTestCase;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||
import com.google.android.exoplayer2.ExoPlayer;
|
||||
import com.google.android.exoplayer2.ExoPlayerFactory;
|
||||
@ -29,29 +32,31 @@ import com.google.android.exoplayer2.source.ExtractorMediaSource;
|
||||
import com.google.android.exoplayer2.source.MediaSource;
|
||||
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Playback tests using {@link LibopusAudioRenderer}.
|
||||
*/
|
||||
public class OpusPlaybackTest extends InstrumentationTestCase {
|
||||
/** Playback tests using {@link LibopusAudioRenderer}. */
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class OpusPlaybackTest {
|
||||
|
||||
private static final String BEAR_OPUS_URI = "asset:///bear-opus.webm";
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
@Before
|
||||
public void setUp() {
|
||||
if (!OpusLibrary.isAvailable()) {
|
||||
fail("Opus library not available.");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBasicPlayback() throws ExoPlaybackException {
|
||||
playUri(BEAR_OPUS_URI);
|
||||
}
|
||||
|
||||
private void playUri(String uri) throws ExoPlaybackException {
|
||||
TestPlaybackRunnable testPlaybackRunnable = new TestPlaybackRunnable(Uri.parse(uri),
|
||||
getInstrumentation().getContext());
|
||||
TestPlaybackRunnable testPlaybackRunnable =
|
||||
new TestPlaybackRunnable(Uri.parse(uri), getContext());
|
||||
Thread thread = new Thread(testPlaybackRunnable);
|
||||
thread.start();
|
||||
try {
|
||||
|
@ -27,6 +27,7 @@ android {
|
||||
minSdkVersion project.ext.minSdkVersion
|
||||
targetSdkVersion project.ext.targetSdkVersion
|
||||
consumerProguardFiles 'proguard-rules.txt'
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
}
|
||||
|
||||
sourceSets.main {
|
||||
@ -38,6 +39,7 @@ android {
|
||||
dependencies {
|
||||
implementation project(modulePrefix + 'library-core')
|
||||
implementation 'com.android.support:support-annotations:' + supportLibraryVersion
|
||||
androidTestImplementation 'androidx.test:runner:' + testRunnerVersion
|
||||
androidTestImplementation 'com.google.truth:truth:' + truthVersion
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,6 @@
|
||||
|
||||
<instrumentation
|
||||
android:targetPackage="com.google.android.exoplayer2.ext.vp9.test"
|
||||
android:name="android.test.InstrumentationTestRunner"/>
|
||||
android:name="androidx.test.runner.AndroidJUnitRunner"/>
|
||||
|
||||
</manifest>
|
||||
|
@ -15,13 +15,15 @@
|
||||
*/
|
||||
package com.google.android.exoplayer2.ext.vp9;
|
||||
|
||||
import static androidx.test.InstrumentationRegistry.getContext;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Looper;
|
||||
import android.test.InstrumentationTestCase;
|
||||
import android.util.Log;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||
import com.google.android.exoplayer2.ExoPlayer;
|
||||
import com.google.android.exoplayer2.ExoPlayerFactory;
|
||||
@ -32,11 +34,13 @@ import com.google.android.exoplayer2.source.ExtractorMediaSource;
|
||||
import com.google.android.exoplayer2.source.MediaSource;
|
||||
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Playback tests using {@link LibvpxVideoRenderer}.
|
||||
*/
|
||||
public class VpxPlaybackTest extends InstrumentationTestCase {
|
||||
/** Playback tests using {@link LibvpxVideoRenderer}. */
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class VpxPlaybackTest {
|
||||
|
||||
private static final String BEAR_URI = "asset:///bear-vp9.webm";
|
||||
private static final String BEAR_ODD_DIMENSIONS_URI = "asset:///bear-vp9-odd-dimensions.webm";
|
||||
@ -45,22 +49,24 @@ public class VpxPlaybackTest extends InstrumentationTestCase {
|
||||
|
||||
private static final String TAG = "VpxPlaybackTest";
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
@Before
|
||||
public void setUp() {
|
||||
if (!VpxLibrary.isAvailable()) {
|
||||
fail("Vpx library not available.");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBasicPlayback() throws ExoPlaybackException {
|
||||
playUri(BEAR_URI);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOddDimensionsPlayback() throws ExoPlaybackException {
|
||||
playUri(BEAR_ODD_DIMENSIONS_URI);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test10BitProfile2Playback() throws ExoPlaybackException {
|
||||
if (VpxLibrary.isHighBitDepthSupported()) {
|
||||
Log.d(TAG, "High Bit Depth supported.");
|
||||
@ -70,6 +76,7 @@ public class VpxPlaybackTest extends InstrumentationTestCase {
|
||||
Log.d(TAG, "High Bit Depth not supported.");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidBitstream() {
|
||||
try {
|
||||
playUri(INVALID_BITSTREAM_URI);
|
||||
@ -81,8 +88,8 @@ public class VpxPlaybackTest extends InstrumentationTestCase {
|
||||
}
|
||||
|
||||
private void playUri(String uri) throws ExoPlaybackException {
|
||||
TestPlaybackRunnable testPlaybackRunnable = new TestPlaybackRunnable(Uri.parse(uri),
|
||||
getInstrumentation().getContext());
|
||||
TestPlaybackRunnable testPlaybackRunnable =
|
||||
new TestPlaybackRunnable(Uri.parse(uri), getContext());
|
||||
Thread thread = new Thread(testPlaybackRunnable);
|
||||
thread.start();
|
||||
try {
|
||||
|
@ -28,7 +28,7 @@ android {
|
||||
targetSdkVersion project.ext.targetSdkVersion
|
||||
consumerProguardFiles 'proguard-rules.txt'
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
|
||||
// The following argument makes the Android Test Orchestrator run its
|
||||
// "pm clear" command after each test invocation. This command ensures
|
||||
@ -39,11 +39,11 @@ android {
|
||||
// Workaround to prevent circular dependency on project :testutils.
|
||||
sourceSets {
|
||||
androidTest {
|
||||
java.srcDirs += "../../testutils/src/main/java/"
|
||||
java.srcDirs += '../../testutils/src/main/java/'
|
||||
}
|
||||
test {
|
||||
java.srcDirs += "../../testutils/src/main/java/"
|
||||
java.srcDirs += "../../testutils_robolectric/src/main/java/"
|
||||
java.srcDirs += '../../testutils/src/main/java/'
|
||||
java.srcDirs += '../../testutils_robolectric/src/main/java/'
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,12 +60,12 @@ dependencies {
|
||||
implementation 'com.android.support:support-annotations:' + supportLibraryVersion
|
||||
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
|
||||
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkVersion
|
||||
androidTestImplementation 'androidx.test:runner:' + testRunnerVersion
|
||||
androidTestImplementation 'com.google.auto.value:auto-value-annotations:' + autoValueVersion
|
||||
androidTestImplementation 'com.google.dexmaker:dexmaker:' + dexmakerVersion
|
||||
androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:' + dexmakerVersion
|
||||
androidTestImplementation 'com.google.truth:truth:' + truthVersion
|
||||
androidTestImplementation 'org.mockito:mockito-core:' + mockitoVersion
|
||||
androidTestImplementation 'androidx.test:runner:' + testRunnerVersion
|
||||
androidTestImplementation 'com.google.auto.value:auto-value-annotations:' + autoValueVersion
|
||||
androidTestAnnotationProcessor 'com.google.auto.value:auto-value:' + autoValueVersion
|
||||
testImplementation 'com.google.truth:truth:' + truthVersion
|
||||
testImplementation 'junit:junit:' + junitVersion
|
||||
|
@ -29,6 +29,6 @@
|
||||
|
||||
<instrumentation
|
||||
android:targetPackage="com.google.android.exoplayer2.core.test"
|
||||
android:name="android.test.InstrumentationTestRunner"/>
|
||||
android:name="androidx.test.runner.AndroidJUnitRunner"/>
|
||||
|
||||
</manifest>
|
||||
|
@ -26,10 +26,13 @@ android {
|
||||
defaultConfig {
|
||||
minSdkVersion project.ext.minSdkVersion
|
||||
targetSdkVersion project.ext.targetSdkVersion
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
androidTestImplementation 'androidx.test:rules:' + testRunnerVersion
|
||||
androidTestImplementation 'androidx.test:runner:' + testRunnerVersion
|
||||
androidTestImplementation project(modulePrefix + 'library-core')
|
||||
androidTestImplementation project(modulePrefix + 'library-dash')
|
||||
androidTestImplementation project(modulePrefix + 'library-hls')
|
||||
|
@ -34,6 +34,6 @@
|
||||
|
||||
<instrumentation
|
||||
android:targetPackage="com.google.android.exoplayer2.playbacktests"
|
||||
android:name="android.test.InstrumentationTestRunner"/>
|
||||
android:name="androidx.test.runner.AndroidJUnitRunner"/>
|
||||
|
||||
</manifest>
|
||||
|
@ -15,17 +15,24 @@
|
||||
*/
|
||||
package com.google.android.exoplayer2.playbacktests.gts;
|
||||
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
import static androidx.test.InstrumentationRegistry.getInstrumentation;
|
||||
|
||||
import androidx.test.rule.ActivityTestRule;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
import com.google.android.exoplayer2.Player;
|
||||
import com.google.android.exoplayer2.testutil.ActionSchedule;
|
||||
import com.google.android.exoplayer2.testutil.HostActivity;
|
||||
import com.google.android.exoplayer2.util.MimeTypes;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Test playback of encrypted DASH streams using different CENC scheme types.
|
||||
*/
|
||||
public final class CommonEncryptionDrmTest extends ActivityInstrumentationTestCase2<HostActivity> {
|
||||
/** Test playback of encrypted DASH streams using different CENC scheme types. */
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public final class CommonEncryptionDrmTest {
|
||||
|
||||
private static final String TAG = "CencDrmTest";
|
||||
|
||||
@ -44,29 +51,26 @@ public final class CommonEncryptionDrmTest extends ActivityInstrumentationTestCa
|
||||
.seekAndWait(270000).delay(10000).seekAndWait(200000).delay(10000).seekAndWait(732000)
|
||||
.build();
|
||||
|
||||
@Rule public ActivityTestRule<HostActivity> testRule = new ActivityTestRule<>(HostActivity.class);
|
||||
|
||||
private DashTestRunner testRunner;
|
||||
|
||||
public CommonEncryptionDrmTest() {
|
||||
super(HostActivity.class);
|
||||
@Before
|
||||
public void setUp() {
|
||||
testRunner =
|
||||
new DashTestRunner(TAG, testRule.getActivity(), getInstrumentation())
|
||||
.setWidevineInfo(MimeTypes.VIDEO_H264, false)
|
||||
.setActionSchedule(ACTION_SCHEDULE_WITH_SEEKS)
|
||||
.setAudioVideoFormats(ID_AUDIO, IDS_VIDEO)
|
||||
.setCanIncludeAdditionalVideoFormats(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
testRunner = new DashTestRunner(TAG, getActivity(), getInstrumentation())
|
||||
.setWidevineInfo(MimeTypes.VIDEO_H264, false)
|
||||
.setActionSchedule(ACTION_SCHEDULE_WITH_SEEKS)
|
||||
.setAudioVideoFormats(ID_AUDIO, IDS_VIDEO)
|
||||
.setCanIncludeAdditionalVideoFormats(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
@After
|
||||
public void tearDown() {
|
||||
testRunner = null;
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCencSchemeTypeV18() {
|
||||
if (Util.SDK_INT < 18) {
|
||||
// Pass.
|
||||
@ -75,6 +79,7 @@ public final class CommonEncryptionDrmTest extends ActivityInstrumentationTestCa
|
||||
testRunner.setStreamName("test_widevine_h264_scheme_cenc").setManifestUrl(URL_cenc).run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCbc1SchemeTypeV25() {
|
||||
if (Util.SDK_INT < 25) {
|
||||
// cbc1 support was added in API 24, but it is stable from API 25 onwards.
|
||||
@ -85,6 +90,7 @@ public final class CommonEncryptionDrmTest extends ActivityInstrumentationTestCa
|
||||
testRunner.setStreamName("test_widevine_h264_scheme_cbc1").setManifestUrl(URL_cbc1).run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCbcsSchemeTypeV25() {
|
||||
if (Util.SDK_INT < 25) {
|
||||
// cbcs support was added in API 24, but it is stable from API 25 onwards.
|
||||
@ -95,8 +101,8 @@ public final class CommonEncryptionDrmTest extends ActivityInstrumentationTestCa
|
||||
testRunner.setStreamName("test_widevine_h264_scheme_cbcs").setManifestUrl(URL_cbcs).run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCensSchemeTypeV25() {
|
||||
// TODO: Implement once content is available. Track [internal: b/31219813].
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,10 +15,12 @@
|
||||
*/
|
||||
package com.google.android.exoplayer2.playbacktests.gts;
|
||||
|
||||
import static androidx.test.InstrumentationRegistry.getInstrumentation;
|
||||
import static com.google.common.truth.Truth.assertWithMessage;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
import androidx.test.rule.ActivityTestRule;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
import com.google.android.exoplayer2.offline.DownloaderConstructorHelper;
|
||||
import com.google.android.exoplayer2.offline.StreamKey;
|
||||
import com.google.android.exoplayer2.source.dash.DashUtil;
|
||||
@ -37,36 +39,38 @@ import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Tests downloaded DASH playbacks.
|
||||
*/
|
||||
public final class DashDownloadTest extends ActivityInstrumentationTestCase2<HostActivity> {
|
||||
/** Tests downloaded DASH playbacks. */
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public final class DashDownloadTest {
|
||||
|
||||
private static final String TAG = "DashDownloadTest";
|
||||
|
||||
private static final Uri MANIFEST_URI = Uri.parse(DashTestData.H264_MANIFEST);
|
||||
|
||||
@Rule public ActivityTestRule<HostActivity> testRule = new ActivityTestRule<>(HostActivity.class);
|
||||
|
||||
private DashTestRunner testRunner;
|
||||
private File tempFolder;
|
||||
private SimpleCache cache;
|
||||
private DefaultHttpDataSourceFactory httpDataSourceFactory;
|
||||
private CacheDataSourceFactory offlineDataSourceFactory;
|
||||
|
||||
public DashDownloadTest() {
|
||||
super(HostActivity.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
testRunner = new DashTestRunner(TAG, getActivity(), getInstrumentation())
|
||||
.setManifestUrl(DashTestData.H264_MANIFEST)
|
||||
.setFullPlaybackNoSeeking(true)
|
||||
.setCanIncludeAdditionalVideoFormats(false)
|
||||
.setAudioVideoFormats(DashTestData.AAC_AUDIO_REPRESENTATION_ID,
|
||||
DashTestData.H264_CDD_FIXED);
|
||||
tempFolder = Util.createTempDirectory(getActivity(), "ExoPlayerTest");
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
testRunner =
|
||||
new DashTestRunner(TAG, testRule.getActivity(), getInstrumentation())
|
||||
.setManifestUrl(DashTestData.H264_MANIFEST)
|
||||
.setFullPlaybackNoSeeking(true)
|
||||
.setCanIncludeAdditionalVideoFormats(false)
|
||||
.setAudioVideoFormats(
|
||||
DashTestData.AAC_AUDIO_REPRESENTATION_ID, DashTestData.H264_CDD_FIXED);
|
||||
tempFolder = Util.createTempDirectory(testRule.getActivity(), "ExoPlayerTest");
|
||||
cache = new SimpleCache(tempFolder, new NoOpCacheEvictor());
|
||||
httpDataSourceFactory = new DefaultHttpDataSourceFactory("ExoPlayer", null);
|
||||
offlineDataSourceFactory =
|
||||
@ -74,16 +78,16 @@ public final class DashDownloadTest extends ActivityInstrumentationTestCase2<Hos
|
||||
cache, DummyDataSource.FACTORY, CacheDataSource.FLAG_BLOCK_ON_CACHE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
@After
|
||||
public void tearDown() {
|
||||
testRunner = null;
|
||||
Util.recursiveDelete(tempFolder);
|
||||
cache = null;
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
// Download tests
|
||||
|
||||
@Test
|
||||
public void testDownload() throws Exception {
|
||||
if (Util.SDK_INT < 16) {
|
||||
return; // Pass.
|
||||
|
@ -15,9 +15,11 @@
|
||||
*/
|
||||
package com.google.android.exoplayer2.playbacktests.gts;
|
||||
|
||||
import static androidx.test.InstrumentationRegistry.getInstrumentation;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
import androidx.test.rule.ActivityTestRule;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
import com.google.android.exoplayer2.ExoPlayer;
|
||||
import com.google.android.exoplayer2.Player;
|
||||
import com.google.android.exoplayer2.mediacodec.MediaCodecInfo;
|
||||
@ -27,11 +29,15 @@ import com.google.android.exoplayer2.testutil.ActionSchedule;
|
||||
import com.google.android.exoplayer2.testutil.HostActivity;
|
||||
import com.google.android.exoplayer2.util.MimeTypes;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Tests DASH playbacks using {@link ExoPlayer}.
|
||||
*/
|
||||
public final class DashStreamingTest extends ActivityInstrumentationTestCase2<HostActivity> {
|
||||
/** Tests DASH playbacks using {@link ExoPlayer}. */
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public final class DashStreamingTest {
|
||||
|
||||
private static final String TAG = "DashStreamingTest";
|
||||
|
||||
@ -78,27 +84,24 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
// Wait 10 seconds, then seek to near end.
|
||||
.delay(10000).seek(120000)
|
||||
.build();
|
||||
|
||||
|
||||
@Rule public ActivityTestRule<HostActivity> testRule = new ActivityTestRule<>(HostActivity.class);
|
||||
|
||||
private DashTestRunner testRunner;
|
||||
|
||||
public DashStreamingTest() {
|
||||
super(HostActivity.class);
|
||||
@Before
|
||||
public void setUp() {
|
||||
testRunner = new DashTestRunner(TAG, testRule.getActivity(), getInstrumentation());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
testRunner = new DashTestRunner(TAG, getActivity(), getInstrumentation());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
@After
|
||||
public void tearDown() {
|
||||
testRunner = null;
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
// H264 CDD.
|
||||
|
||||
@Test
|
||||
public void testH264Fixed() {
|
||||
if (Util.SDK_INT < 16) {
|
||||
// Pass.
|
||||
@ -113,6 +116,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testH264Adaptive() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 16 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
|
||||
// Pass.
|
||||
@ -128,6 +132,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testH264AdaptiveWithSeeking() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 16 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
|
||||
// Pass.
|
||||
@ -145,6 +150,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testH264AdaptiveWithRendererDisabling() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 16 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
|
||||
// Pass.
|
||||
@ -164,6 +170,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
|
||||
// H265 CDD.
|
||||
|
||||
@Test
|
||||
public void testH265FixedV23() {
|
||||
if (Util.SDK_INT < 23) {
|
||||
// Pass.
|
||||
@ -178,6 +185,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testH265AdaptiveV24() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 24) {
|
||||
// Pass.
|
||||
@ -193,6 +201,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testH265AdaptiveWithSeekingV24() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 24) {
|
||||
// Pass.
|
||||
@ -209,6 +218,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testH265AdaptiveWithRendererDisablingV24() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 24) {
|
||||
// Pass.
|
||||
@ -227,6 +237,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
|
||||
// VP9 (CDD).
|
||||
|
||||
@Test
|
||||
public void testVp9Fixed360pV23() {
|
||||
if (Util.SDK_INT < 23) {
|
||||
// Pass.
|
||||
@ -242,6 +253,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVp9AdaptiveV24() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 24) {
|
||||
// Pass.
|
||||
@ -257,6 +269,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVp9AdaptiveWithSeekingV24() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 24) {
|
||||
// Pass.
|
||||
@ -273,6 +286,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVp9AdaptiveWithRendererDisablingV24() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 24) {
|
||||
// Pass.
|
||||
@ -292,6 +306,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
// H264: Other frame-rates for output buffer count assertions.
|
||||
|
||||
// 23.976 fps.
|
||||
@Test
|
||||
public void test23FpsH264FixedV23() {
|
||||
if (Util.SDK_INT < 23) {
|
||||
// Pass.
|
||||
@ -308,6 +323,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
}
|
||||
|
||||
// 24 fps.
|
||||
@Test
|
||||
public void test24FpsH264FixedV23() {
|
||||
if (Util.SDK_INT < 23) {
|
||||
// Pass.
|
||||
@ -324,6 +340,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
}
|
||||
|
||||
// 29.97 fps.
|
||||
@Test
|
||||
public void test29FpsH264FixedV23() {
|
||||
if (Util.SDK_INT < 23) {
|
||||
// Pass.
|
||||
@ -342,6 +359,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
// Widevine encrypted media tests.
|
||||
// H264 CDD.
|
||||
|
||||
@Test
|
||||
public void testWidevineH264FixedV18() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 18) {
|
||||
// Pass.
|
||||
@ -358,6 +376,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWidevineH264AdaptiveV18() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 18 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
|
||||
// Pass.
|
||||
@ -374,6 +393,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWidevineH264AdaptiveWithSeekingV18() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 18 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
|
||||
// Pass.
|
||||
@ -391,6 +411,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWidevineH264AdaptiveWithRendererDisablingV18() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 18 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
|
||||
// Pass.
|
||||
@ -410,6 +431,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
|
||||
// H265 CDD.
|
||||
|
||||
@Test
|
||||
public void testWidevineH265FixedV23() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 23) {
|
||||
// Pass.
|
||||
@ -426,6 +448,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWidevineH265AdaptiveV24() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 24) {
|
||||
// Pass.
|
||||
@ -442,6 +465,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWidevineH265AdaptiveWithSeekingV24() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 24) {
|
||||
// Pass.
|
||||
@ -459,6 +483,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWidevineH265AdaptiveWithRendererDisablingV24() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 24) {
|
||||
// Pass.
|
||||
@ -478,6 +503,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
|
||||
// VP9 (CDD).
|
||||
|
||||
@Test
|
||||
public void testWidevineVp9Fixed360pV23() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 23) {
|
||||
// Pass.
|
||||
@ -494,6 +520,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWidevineVp9AdaptiveV24() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 24) {
|
||||
// Pass.
|
||||
@ -510,6 +537,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWidevineVp9AdaptiveWithSeekingV24() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 24) {
|
||||
// Pass.
|
||||
@ -527,6 +555,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWidevineVp9AdaptiveWithRendererDisablingV24() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 24) {
|
||||
// Pass.
|
||||
@ -547,6 +576,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
// H264: Other frame-rates for output buffer count assertions.
|
||||
|
||||
// 23.976 fps.
|
||||
@Test
|
||||
public void testWidevine23FpsH264FixedV23() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 23) {
|
||||
// Pass.
|
||||
@ -564,6 +594,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
}
|
||||
|
||||
// 24 fps.
|
||||
@Test
|
||||
public void testWidevine24FpsH264FixedV23() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 23) {
|
||||
// Pass.
|
||||
@ -581,6 +612,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
}
|
||||
|
||||
// 29.97 fps.
|
||||
@Test
|
||||
public void testWidevine29FpsH264FixedV23() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 23) {
|
||||
// Pass.
|
||||
@ -599,6 +631,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
|
||||
// Decoder info.
|
||||
|
||||
@Test
|
||||
public void testDecoderInfoH264() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 16) {
|
||||
// Pass.
|
||||
@ -609,6 +642,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
assertThat(Util.SDK_INT < 21 || decoderInfo.adaptive).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDecoderInfoH265V24() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 24) {
|
||||
// Pass.
|
||||
@ -617,6 +651,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
|
||||
assertThat(MediaCodecUtil.getDecoderInfo(MimeTypes.VIDEO_H265, false).adaptive).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDecoderInfoVP9V24() throws DecoderQueryException {
|
||||
if (Util.SDK_INT < 24) {
|
||||
// Pass.
|
||||
|
@ -15,13 +15,16 @@
|
||||
*/
|
||||
package com.google.android.exoplayer2.playbacktests.gts;
|
||||
|
||||
import static androidx.test.InstrumentationRegistry.getInstrumentation;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth.assertWithMessage;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import android.media.MediaDrm.MediaDrmStateException;
|
||||
import android.net.Uri;
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
import android.util.Pair;
|
||||
import androidx.test.rule.ActivityTestRule;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
import com.google.android.exoplayer2.Player;
|
||||
import com.google.android.exoplayer2.drm.DrmInitData;
|
||||
import com.google.android.exoplayer2.drm.DrmSession.DrmSessionException;
|
||||
@ -36,11 +39,15 @@ import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory;
|
||||
import com.google.android.exoplayer2.util.MimeTypes;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.IOException;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Tests Widevine encrypted DASH playbacks using offline keys.
|
||||
*/
|
||||
public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCase2<HostActivity> {
|
||||
/** Tests Widevine encrypted DASH playbacks using offline keys. */
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public final class DashWidevineOfflineTest {
|
||||
|
||||
private static final String TAG = "DashWidevineOfflineTest";
|
||||
private static final String USER_AGENT = "ExoPlayerPlaybackTests";
|
||||
@ -50,21 +57,20 @@ public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCa
|
||||
private OfflineLicenseHelper<FrameworkMediaCrypto> offlineLicenseHelper;
|
||||
private byte[] offlineLicenseKeySetId;
|
||||
|
||||
public DashWidevineOfflineTest() {
|
||||
super(HostActivity.class);
|
||||
}
|
||||
@Rule public ActivityTestRule<HostActivity> testRule = new ActivityTestRule<>(HostActivity.class);
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
testRunner = new DashTestRunner(TAG, getActivity(), getInstrumentation())
|
||||
.setStreamName("test_widevine_h264_fixed_offline")
|
||||
.setManifestUrl(DashTestData.WIDEVINE_H264_MANIFEST)
|
||||
.setWidevineInfo(MimeTypes.VIDEO_H264, true)
|
||||
.setFullPlaybackNoSeeking(true)
|
||||
.setCanIncludeAdditionalVideoFormats(false)
|
||||
.setAudioVideoFormats(DashTestData.WIDEVINE_AAC_AUDIO_REPRESENTATION_ID,
|
||||
DashTestData.WIDEVINE_H264_CDD_FIXED);
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
testRunner =
|
||||
new DashTestRunner(TAG, testRule.getActivity(), getInstrumentation())
|
||||
.setStreamName("test_widevine_h264_fixed_offline")
|
||||
.setManifestUrl(DashTestData.WIDEVINE_H264_MANIFEST)
|
||||
.setWidevineInfo(MimeTypes.VIDEO_H264, true)
|
||||
.setFullPlaybackNoSeeking(true)
|
||||
.setCanIncludeAdditionalVideoFormats(false)
|
||||
.setAudioVideoFormats(
|
||||
DashTestData.WIDEVINE_AAC_AUDIO_REPRESENTATION_ID,
|
||||
DashTestData.WIDEVINE_H264_CDD_FIXED);
|
||||
|
||||
boolean useL1Widevine = DashTestRunner.isL1WidevineAvailable(MimeTypes.VIDEO_H264);
|
||||
String widevineLicenseUrl = DashTestData.getWidevineLicenseUrl(true, useL1Widevine);
|
||||
@ -75,8 +81,8 @@ public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCa
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
testRunner = null;
|
||||
if (offlineLicenseKeySetId != null) {
|
||||
releaseLicense();
|
||||
@ -86,11 +92,11 @@ public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCa
|
||||
}
|
||||
offlineLicenseHelper = null;
|
||||
httpDataSourceFactory = null;
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
// Offline license tests
|
||||
|
||||
@Test
|
||||
public void testWidevineOfflineLicenseV22() throws Exception {
|
||||
if (Util.SDK_INT < 22) {
|
||||
return; // Pass.
|
||||
@ -103,6 +109,7 @@ public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCa
|
||||
assertThat(offlineLicenseKeySetId).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWidevineOfflineReleasedLicenseV22() throws Throwable {
|
||||
if (Util.SDK_INT < 22) {
|
||||
return; // Pass.
|
||||
@ -129,6 +136,7 @@ public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCa
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWidevineOfflineExpiredLicenseV22() throws Exception {
|
||||
if (Util.SDK_INT < 22) {
|
||||
return; // Pass.
|
||||
@ -158,6 +166,7 @@ public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCa
|
||||
testRunner.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWidevineOfflineLicenseExpiresOnPauseV22() throws Exception {
|
||||
if (Util.SDK_INT < 22) {
|
||||
return; // Pass.
|
||||
|
@ -15,11 +15,13 @@
|
||||
*/
|
||||
package com.google.android.exoplayer2.playbacktests.gts;
|
||||
|
||||
import static androidx.test.InstrumentationRegistry.getInstrumentation;
|
||||
|
||||
import android.media.MediaCodecInfo.AudioCapabilities;
|
||||
import android.media.MediaCodecInfo.CodecCapabilities;
|
||||
import android.media.MediaCodecInfo.CodecProfileLevel;
|
||||
import android.media.MediaCodecInfo.VideoCapabilities;
|
||||
import android.test.InstrumentationTestCase;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
import com.google.android.exoplayer2.mediacodec.MediaCodecInfo;
|
||||
import com.google.android.exoplayer2.mediacodec.MediaCodecUtil;
|
||||
import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException;
|
||||
@ -29,9 +31,13 @@ import com.google.android.exoplayer2.util.MimeTypes;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/** Tests enumeration of decoders using {@link MediaCodecUtil}. */
|
||||
public class EnumerateDecodersTest extends InstrumentationTestCase {
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class EnumerateDecodersTest {
|
||||
|
||||
private static final String TAG = "EnumerateDecodersTest";
|
||||
|
||||
@ -40,14 +46,14 @@ public class EnumerateDecodersTest extends InstrumentationTestCase {
|
||||
|
||||
private MetricsLogger metricsLogger;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
@Before
|
||||
public void setUp() {
|
||||
metricsLogger =
|
||||
MetricsLogger.Factory.createDefault(
|
||||
getInstrumentation(), TAG, REPORT_NAME, REPORT_OBJECT_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEnumerateDecoders() throws Exception {
|
||||
enumerateDecoders(MimeTypes.VIDEO_H263);
|
||||
enumerateDecoders(MimeTypes.VIDEO_H264);
|
||||
|
Loading…
x
Reference in New Issue
Block a user