From b6036561c27284bc618fb5e8b6ca0497328a91d5 Mon Sep 17 00:00:00 2001 From: ibaker Date: Tue, 22 Sep 2020 09:57:16 +0100 Subject: [PATCH] Exclude PC devices from H.265 GTS tests PiperOrigin-RevId: 333031399 --- .../playbacktests/gts/DashStreamingTest.java | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/DashStreamingTest.java b/playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/DashStreamingTest.java index a2f557ca0d..c3e82ec33d 100644 --- a/playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/DashStreamingTest.java +++ b/playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/DashStreamingTest.java @@ -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);