Exclude PC devices from H.265 GTS tests

PiperOrigin-RevId: 333031399
This commit is contained in:
ibaker 2020-09-22 09:57:16 +01:00 committed by Oliver Woodman
parent 1b5d07c105
commit b6036561c2

View file

@ -18,6 +18,7 @@ package com.google.android.exoplayer2.playbacktests.gts;
import static com.google.android.exoplayer2.playbacktests.gts.GtsTestUtil.shouldSkipWidevineTest;
import static com.google.common.truth.Truth.assertThat;
import android.content.pm.PackageManager;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;
import com.google.android.exoplayer2.ExoPlayer;
@ -168,7 +169,7 @@ public final class DashStreamingTest {
@Test
public void h265FixedV23() throws Exception {
if (Util.SDK_INT < 23) {
if (Util.SDK_INT < 23 || isPc()) {
// Pass.
return;
}
@ -183,7 +184,7 @@ public final class DashStreamingTest {
@Test
public void h265AdaptiveV24() throws Exception {
if (Util.SDK_INT < 24) {
if (Util.SDK_INT < 24 || isPc()) {
// Pass.
return;
}
@ -199,7 +200,7 @@ public final class DashStreamingTest {
@Test
public void h265AdaptiveWithSeekingV24() throws Exception {
if (Util.SDK_INT < 24) {
if (Util.SDK_INT < 24 || isPc()) {
// Pass.
return;
}
@ -216,7 +217,7 @@ public final class DashStreamingTest {
@Test
public void h265AdaptiveWithRendererDisablingV24() throws Exception {
if (Util.SDK_INT < 24) {
if (Util.SDK_INT < 24 || isPc()) {
// Pass.
return;
}
@ -435,7 +436,7 @@ public final class DashStreamingTest {
@Test
public void widevineH265FixedV23() throws Exception {
if (Util.SDK_INT < 23 || GtsTestUtil.shouldSkipWidevineTest(testRule.getActivity())) {
if (Util.SDK_INT < 23 || GtsTestUtil.shouldSkipWidevineTest(testRule.getActivity()) || isPc()) {
// Pass.
return;
}
@ -452,7 +453,7 @@ public final class DashStreamingTest {
@Test
public void widevineH265AdaptiveV24() throws Exception {
if (Util.SDK_INT < 24 || GtsTestUtil.shouldSkipWidevineTest(testRule.getActivity())) {
if (Util.SDK_INT < 24 || GtsTestUtil.shouldSkipWidevineTest(testRule.getActivity()) || isPc()) {
// Pass.
return;
}
@ -469,7 +470,7 @@ public final class DashStreamingTest {
@Test
public void widevineH265AdaptiveWithSeekingV24() throws Exception {
if (Util.SDK_INT < 24 || GtsTestUtil.shouldSkipWidevineTest(testRule.getActivity())) {
if (Util.SDK_INT < 24 || GtsTestUtil.shouldSkipWidevineTest(testRule.getActivity()) || isPc()) {
// Pass.
return;
}
@ -487,7 +488,7 @@ public final class DashStreamingTest {
@Test
public void widevineH265AdaptiveWithRendererDisablingV24() throws Exception {
if (Util.SDK_INT < 24 || GtsTestUtil.shouldSkipWidevineTest(testRule.getActivity())) {
if (Util.SDK_INT < 24 || GtsTestUtil.shouldSkipWidevineTest(testRule.getActivity()) || isPc()) {
// Pass.
return;
}
@ -644,7 +645,7 @@ public final class DashStreamingTest {
@Test
public void decoderInfoH265V24() throws Exception {
if (Util.SDK_INT < 24) {
if (Util.SDK_INT < 24 || isPc()) {
// Pass.
return;
}
@ -670,6 +671,11 @@ public final class DashStreamingTest {
// Internal.
private boolean isPc() {
// See [internal b/162990153].
return testRule.getActivity().getPackageManager().hasSystemFeature(PackageManager.FEATURE_PC);
}
private static boolean shouldSkipAdaptiveTest(String mimeType) throws DecoderQueryException {
MediaCodecInfo decoderInfo =
MediaCodecUtil.getDecoderInfo(mimeType, /* secure= */ false, /* tunneling= */ false);