Commit f6821c6d by tonihei Committed by Oliver Woodman

Split playbacktests mobile_test into multiple version-dependent test targets.

MobileHarness allocates random devices for each test and repeats tests up to 5 times to
account for spurious test failures. Some of our tests automatically pass for SDK versions
below a certain threshold. Thus, even if such a version-guarded test would always fail,
the MobileHarness test is likely to succeed as it only needs one random allocation to a
device with a lower SDK version.

To prevent this behaviour and to make sure all tests are actually run, the mobile_test
target is split into multiple targets one for each minimum SDK version.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172447046
parent ac31dc7c
...@@ -67,7 +67,7 @@ public final class CommonEncryptionDrmTest extends ActivityInstrumentationTestCa ...@@ -67,7 +67,7 @@ public final class CommonEncryptionDrmTest extends ActivityInstrumentationTestCa
super.tearDown(); super.tearDown();
} }
public void testCencSchemeType() { public void testCencSchemeTypeV18() {
if (Util.SDK_INT < 18) { if (Util.SDK_INT < 18) {
// Pass. // Pass.
return; return;
...@@ -75,7 +75,7 @@ public final class CommonEncryptionDrmTest extends ActivityInstrumentationTestCa ...@@ -75,7 +75,7 @@ public final class CommonEncryptionDrmTest extends ActivityInstrumentationTestCa
testRunner.setStreamName("test_widevine_h264_scheme_cenc").setManifestUrl(URL_cenc).run(); testRunner.setStreamName("test_widevine_h264_scheme_cenc").setManifestUrl(URL_cenc).run();
} }
public void testCbc1SchemeType() { public void testCbc1SchemeTypeV25() {
if (Util.SDK_INT < 25) { if (Util.SDK_INT < 25) {
// cbc1 support was added in API 24, but it is stable from API 25 onwards. // cbc1 support was added in API 24, but it is stable from API 25 onwards.
// See [internal: b/65634809]. // See [internal: b/65634809].
...@@ -85,7 +85,7 @@ public final class CommonEncryptionDrmTest extends ActivityInstrumentationTestCa ...@@ -85,7 +85,7 @@ public final class CommonEncryptionDrmTest extends ActivityInstrumentationTestCa
testRunner.setStreamName("test_widevine_h264_scheme_cbc1").setManifestUrl(URL_cbc1).run(); testRunner.setStreamName("test_widevine_h264_scheme_cbc1").setManifestUrl(URL_cbc1).run();
} }
public void testCbcsSchemeType() { public void testCbcsSchemeTypeV25() {
if (Util.SDK_INT < 25) { if (Util.SDK_INT < 25) {
// cbcs support was added in API 24, but it is stable from API 25 onwards. // cbcs support was added in API 24, but it is stable from API 25 onwards.
// See [internal: b/65634809]. // See [internal: b/65634809].
...@@ -95,7 +95,7 @@ public final class CommonEncryptionDrmTest extends ActivityInstrumentationTestCa ...@@ -95,7 +95,7 @@ public final class CommonEncryptionDrmTest extends ActivityInstrumentationTestCa
testRunner.setStreamName("test_widevine_h264_scheme_cbcs").setManifestUrl(URL_cbcs).run(); testRunner.setStreamName("test_widevine_h264_scheme_cbcs").setManifestUrl(URL_cbcs).run();
} }
public void testCensSchemeType() { public void testCensSchemeTypeV25() {
// TODO: Implement once content is available. Track [internal: b/31219813]. // TODO: Implement once content is available. Track [internal: b/31219813].
} }
......
...@@ -162,7 +162,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -162,7 +162,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
// H265 CDD. // H265 CDD.
public void testH265Fixed() { public void testH265FixedV23() {
if (Util.SDK_INT < 23) { if (Util.SDK_INT < 23) {
// Pass. // Pass.
return; return;
...@@ -176,8 +176,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -176,8 +176,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testH265Adaptive() throws DecoderQueryException { public void testH265AdaptiveV24() throws DecoderQueryException {
if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H265)) { if (Util.SDK_INT < 24) {
// Pass. // Pass.
return; return;
} }
...@@ -191,8 +191,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -191,8 +191,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testH265AdaptiveWithSeeking() throws DecoderQueryException { public void testH265AdaptiveWithSeekingV24() throws DecoderQueryException {
if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H265)) { if (Util.SDK_INT < 24) {
// Pass. // Pass.
return; return;
} }
...@@ -207,8 +207,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -207,8 +207,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testH265AdaptiveWithRendererDisabling() throws DecoderQueryException { public void testH265AdaptiveWithRendererDisablingV24() throws DecoderQueryException {
if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H265)) { if (Util.SDK_INT < 24) {
// Pass. // Pass.
return; return;
} }
...@@ -225,7 +225,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -225,7 +225,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
// VP9 (CDD). // VP9 (CDD).
public void testVp9Fixed360p() { public void testVp9Fixed360pV23() {
if (Util.SDK_INT < 23) { if (Util.SDK_INT < 23) {
// Pass. // Pass.
return; return;
...@@ -240,8 +240,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -240,8 +240,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testVp9Adaptive() throws DecoderQueryException { public void testVp9AdaptiveV24() throws DecoderQueryException {
if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_VP9)) { if (Util.SDK_INT < 24) {
// Pass. // Pass.
return; return;
} }
...@@ -255,8 +255,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -255,8 +255,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testVp9AdaptiveWithSeeking() throws DecoderQueryException { public void testVp9AdaptiveWithSeekingV24() throws DecoderQueryException {
if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_VP9)) { if (Util.SDK_INT < 24) {
// Pass. // Pass.
return; return;
} }
...@@ -271,8 +271,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -271,8 +271,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testVp9AdaptiveWithRendererDisabling() throws DecoderQueryException { public void testVp9AdaptiveWithRendererDisablingV24() throws DecoderQueryException {
if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_VP9)) { if (Util.SDK_INT < 24) {
// Pass. // Pass.
return; return;
} }
...@@ -290,7 +290,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -290,7 +290,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
// H264: Other frame-rates for output buffer count assertions. // H264: Other frame-rates for output buffer count assertions.
// 23.976 fps. // 23.976 fps.
public void test23FpsH264Fixed() { public void test23FpsH264FixedV23() {
if (Util.SDK_INT < 23) { if (Util.SDK_INT < 23) {
// Pass. // Pass.
return; return;
...@@ -306,7 +306,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -306,7 +306,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
} }
// 24 fps. // 24 fps.
public void test24FpsH264Fixed() { public void test24FpsH264FixedV23() {
if (Util.SDK_INT < 23) { if (Util.SDK_INT < 23) {
// Pass. // Pass.
return; return;
...@@ -322,7 +322,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -322,7 +322,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
} }
// 29.97 fps. // 29.97 fps.
public void test29FpsH264Fixed() { public void test29FpsH264FixedV23() {
if (Util.SDK_INT < 23) { if (Util.SDK_INT < 23) {
// Pass. // Pass.
return; return;
...@@ -340,7 +340,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -340,7 +340,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
// Widevine encrypted media tests. // Widevine encrypted media tests.
// H264 CDD. // H264 CDD.
public void testWidevineH264Fixed() throws DecoderQueryException { public void testWidevineH264FixedV18() throws DecoderQueryException {
if (Util.SDK_INT < 18) { if (Util.SDK_INT < 18) {
// Pass. // Pass.
return; return;
...@@ -356,7 +356,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -356,7 +356,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testWidevineH264Adaptive() throws DecoderQueryException { public void testWidevineH264AdaptiveV18() throws DecoderQueryException {
if (Util.SDK_INT < 18 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) { if (Util.SDK_INT < 18 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
// Pass. // Pass.
return; return;
...@@ -372,7 +372,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -372,7 +372,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testWidevineH264AdaptiveWithSeeking() throws DecoderQueryException { public void testWidevineH264AdaptiveWithSeekingV18() throws DecoderQueryException {
if (Util.SDK_INT < 18 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) { if (Util.SDK_INT < 18 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
// Pass. // Pass.
return; return;
...@@ -389,7 +389,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -389,7 +389,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testWidevineH264AdaptiveWithRendererDisabling() throws DecoderQueryException { public void testWidevineH264AdaptiveWithRendererDisablingV18() throws DecoderQueryException {
if (Util.SDK_INT < 18 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) { if (Util.SDK_INT < 18 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
// Pass. // Pass.
return; return;
...@@ -408,7 +408,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -408,7 +408,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
// H265 CDD. // H265 CDD.
public void testWidevineH265Fixed() throws DecoderQueryException { public void testWidevineH265FixedV23() throws DecoderQueryException {
if (Util.SDK_INT < 23) { if (Util.SDK_INT < 23) {
// Pass. // Pass.
return; return;
...@@ -424,8 +424,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -424,8 +424,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testWidevineH265Adaptive() throws DecoderQueryException { public void testWidevineH265AdaptiveV24() throws DecoderQueryException {
if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H265)) { if (Util.SDK_INT < 24) {
// Pass. // Pass.
return; return;
} }
...@@ -440,8 +440,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -440,8 +440,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testWidevineH265AdaptiveWithSeeking() throws DecoderQueryException { public void testWidevineH265AdaptiveWithSeekingV24() throws DecoderQueryException {
if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H265)) { if (Util.SDK_INT < 24) {
// Pass. // Pass.
return; return;
} }
...@@ -457,8 +457,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -457,8 +457,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testWidevineH265AdaptiveWithRendererDisabling() throws DecoderQueryException { public void testWidevineH265AdaptiveWithRendererDisablingV24() throws DecoderQueryException {
if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H265)) { if (Util.SDK_INT < 24) {
// Pass. // Pass.
return; return;
} }
...@@ -476,7 +476,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -476,7 +476,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
// VP9 (CDD). // VP9 (CDD).
public void testWidevineVp9Fixed360p() throws DecoderQueryException { public void testWidevineVp9Fixed360pV23() throws DecoderQueryException {
if (Util.SDK_INT < 23) { if (Util.SDK_INT < 23) {
// Pass. // Pass.
return; return;
...@@ -492,8 +492,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -492,8 +492,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testWidevineVp9Adaptive() throws DecoderQueryException { public void testWidevineVp9AdaptiveV24() throws DecoderQueryException {
if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_VP9)) { if (Util.SDK_INT < 24) {
// Pass. // Pass.
return; return;
} }
...@@ -508,8 +508,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -508,8 +508,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testWidevineVp9AdaptiveWithSeeking() throws DecoderQueryException { public void testWidevineVp9AdaptiveWithSeekingV24() throws DecoderQueryException {
if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_VP9)) { if (Util.SDK_INT < 24) {
// Pass. // Pass.
return; return;
} }
...@@ -525,8 +525,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -525,8 +525,8 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
public void testWidevineVp9AdaptiveWithRendererDisabling() throws DecoderQueryException { public void testWidevineVp9AdaptiveWithRendererDisablingV24() throws DecoderQueryException {
if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_VP9)) { if (Util.SDK_INT < 24) {
// Pass. // Pass.
return; return;
} }
...@@ -545,7 +545,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -545,7 +545,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
// H264: Other frame-rates for output buffer count assertions. // H264: Other frame-rates for output buffer count assertions.
// 23.976 fps. // 23.976 fps.
public void testWidevine23FpsH264Fixed() throws DecoderQueryException { public void testWidevine23FpsH264FixedV23() throws DecoderQueryException {
if (Util.SDK_INT < 23) { if (Util.SDK_INT < 23) {
// Pass. // Pass.
return; return;
...@@ -562,7 +562,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -562,7 +562,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
} }
// 24 fps. // 24 fps.
public void testWidevine24FpsH264Fixed() throws DecoderQueryException { public void testWidevine24FpsH264FixedV23() throws DecoderQueryException {
if (Util.SDK_INT < 23) { if (Util.SDK_INT < 23) {
// Pass. // Pass.
return; return;
...@@ -579,7 +579,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -579,7 +579,7 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
} }
// 29.97 fps. // 29.97 fps.
public void testWidevine29FpsH264Fixed() throws DecoderQueryException { public void testWidevine29FpsH264FixedV23() throws DecoderQueryException {
if (Util.SDK_INT < 23) { if (Util.SDK_INT < 23) {
// Pass. // Pass.
return; return;
...@@ -595,16 +595,39 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho ...@@ -595,16 +595,39 @@ public final class DashStreamingTest extends ActivityInstrumentationTestCase2<Ho
.run(); .run();
} }
// Decoder info.
public void testDecoderInfoH264() throws DecoderQueryException {
if (Util.SDK_INT < 16) {
// Pass.
return;
}
MediaCodecInfo decoderInfo = MediaCodecUtil.getDecoderInfo(MimeTypes.VIDEO_H264, false);
assertNotNull(decoderInfo);
assertTrue(Util.SDK_INT < 21 || decoderInfo.adaptive);
}
public void testDecoderInfoH265V24() throws DecoderQueryException {
if (Util.SDK_INT < 24) {
// Pass.
return;
}
assertTrue(MediaCodecUtil.getDecoderInfo(MimeTypes.VIDEO_H265, false).adaptive);
}
public void testDecoderInfoVP9V24() throws DecoderQueryException {
if (Util.SDK_INT < 24) {
// Pass.
return;
}
assertTrue(MediaCodecUtil.getDecoderInfo(MimeTypes.VIDEO_VP9, false).adaptive);
}
// Internal. // Internal.
private static boolean shouldSkipAdaptiveTest(String mimeType) throws DecoderQueryException { private static boolean shouldSkipAdaptiveTest(String mimeType) throws DecoderQueryException {
MediaCodecInfo decoderInfo = MediaCodecUtil.getDecoderInfo(mimeType, false); MediaCodecInfo decoderInfo = MediaCodecUtil.getDecoderInfo(mimeType, false);
assertNotNull(decoderInfo); return decoderInfo == null || !decoderInfo.adaptive;
if (decoderInfo.adaptive) {
return false;
}
assertTrue(Util.SDK_INT < 21);
return true;
} }
} }
...@@ -89,7 +89,7 @@ public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCa ...@@ -89,7 +89,7 @@ public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCa
// Offline license tests // Offline license tests
public void testWidevineOfflineLicense() throws Exception { public void testWidevineOfflineLicenseV22() throws Exception {
if (Util.SDK_INT < 22) { if (Util.SDK_INT < 22) {
return; // Pass. return; // Pass.
} }
...@@ -101,7 +101,7 @@ public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCa ...@@ -101,7 +101,7 @@ public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCa
Assert.assertNotNull(offlineLicenseKeySetId); Assert.assertNotNull(offlineLicenseKeySetId);
} }
public void testWidevineOfflineReleasedLicense() throws Throwable { public void testWidevineOfflineReleasedLicenseV22() throws Throwable {
if (Util.SDK_INT < 22) { if (Util.SDK_INT < 22) {
return; // Pass. return; // Pass.
} }
...@@ -127,7 +127,7 @@ public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCa ...@@ -127,7 +127,7 @@ public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCa
} }
} }
public void testWidevineOfflineExpiredLicense() throws Exception { public void testWidevineOfflineExpiredLicenseV22() throws Exception {
if (Util.SDK_INT < 22) { if (Util.SDK_INT < 22) {
return; // Pass. return; // Pass.
} }
...@@ -152,7 +152,7 @@ public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCa ...@@ -152,7 +152,7 @@ public final class DashWidevineOfflineTest extends ActivityInstrumentationTestCa
testRunner.run(); testRunner.run();
} }
public void testWidevineOfflineLicenseExpiresOnPause() throws Exception { public void testWidevineOfflineLicenseExpiresOnPauseV22() throws Exception {
if (Util.SDK_INT < 22) { if (Util.SDK_INT < 22) {
return; // Pass. return; // Pass.
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment