Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3af82b2a
authored
Aug 19, 2020
by
ibaker
Committed by
Oliver Woodman
Aug 21, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Skip WV tests on devices where WV is unsupported
PiperOrigin-RevId: 327392056
parent
b85ff574
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
23 deletions
playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/CommonEncryptionDrmTest.java
playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/DashStreamingTest.java
playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/DashWidevineOfflineTest.java
playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/GtsTestUtil.java
playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/CommonEncryptionDrmTest.java
View file @
3af82b2a
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
*/
*/
package
com
.
google
.
android
.
exoplayer2
.
playbacktests
.
gts
;
package
com
.
google
.
android
.
exoplayer2
.
playbacktests
.
gts
;
import
static
com
.
google
.
android
.
exoplayer2
.
playbacktests
.
gts
.
GtsTestUtil
.
shouldSkipWidevineTest
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
androidx.test.rule.ActivityTestRule
;
import
androidx.test.rule.ActivityTestRule
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.Player
;
...
@@ -64,7 +66,7 @@ public final class CommonEncryptionDrmTest {
...
@@ -64,7 +66,7 @@ public final class CommonEncryptionDrmTest {
@Test
@Test
public
void
cencSchemeTypeV18
()
{
public
void
cencSchemeTypeV18
()
{
if
(
Util
.
SDK_INT
<
18
)
{
if
(
Util
.
SDK_INT
<
18
||
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -76,7 +78,7 @@ public final class CommonEncryptionDrmTest {
...
@@ -76,7 +78,7 @@ public final class CommonEncryptionDrmTest {
@Test
@Test
public
void
cbcsSchemeTypeV25
()
{
public
void
cbcsSchemeTypeV25
()
{
if
(
Util
.
SDK_INT
<
25
)
{
if
(
Util
.
SDK_INT
<
25
||
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
// 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].
// Pass.
// Pass.
...
...
playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/DashStreamingTest.java
View file @
3af82b2a
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
*/
*/
package
com
.
google
.
android
.
exoplayer2
.
playbacktests
.
gts
;
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
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
...
@@ -356,7 +357,7 @@ public final class DashStreamingTest {
...
@@ -356,7 +357,7 @@ public final class DashStreamingTest {
@Test
@Test
public
void
widevineH264FixedV18
()
throws
Exception
{
public
void
widevineH264FixedV18
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
18
)
{
if
(
Util
.
SDK_INT
<
18
||
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -373,7 +374,9 @@ public final class DashStreamingTest {
...
@@ -373,7 +374,9 @@ public final class DashStreamingTest {
@Test
@Test
public
void
widevineH264AdaptiveV18
()
throws
Exception
{
public
void
widevineH264AdaptiveV18
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
18
||
shouldSkipAdaptiveTest
(
MimeTypes
.
VIDEO_H264
))
{
if
(
Util
.
SDK_INT
<
18
||
shouldSkipAdaptiveTest
(
MimeTypes
.
VIDEO_H264
)
||
shouldSkipWidevineTest
(
testRule
.
getActivity
()))
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -390,7 +393,9 @@ public final class DashStreamingTest {
...
@@ -390,7 +393,9 @@ public final class DashStreamingTest {
@Test
@Test
public
void
widevineH264AdaptiveWithSeekingV18
()
throws
Exception
{
public
void
widevineH264AdaptiveWithSeekingV18
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
18
||
shouldSkipAdaptiveTest
(
MimeTypes
.
VIDEO_H264
))
{
if
(
Util
.
SDK_INT
<
18
||
shouldSkipAdaptiveTest
(
MimeTypes
.
VIDEO_H264
)
||
shouldSkipWidevineTest
(
testRule
.
getActivity
()))
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -408,7 +413,9 @@ public final class DashStreamingTest {
...
@@ -408,7 +413,9 @@ public final class DashStreamingTest {
@Test
@Test
public
void
widevineH264AdaptiveWithRendererDisablingV18
()
throws
Exception
{
public
void
widevineH264AdaptiveWithRendererDisablingV18
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
18
||
shouldSkipAdaptiveTest
(
MimeTypes
.
VIDEO_H264
))
{
if
(
Util
.
SDK_INT
<
18
||
shouldSkipAdaptiveTest
(
MimeTypes
.
VIDEO_H264
)
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
()))
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -428,7 +435,7 @@ public final class DashStreamingTest {
...
@@ -428,7 +435,7 @@ public final class DashStreamingTest {
@Test
@Test
public
void
widevineH265FixedV23
()
throws
Exception
{
public
void
widevineH265FixedV23
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
23
)
{
if
(
Util
.
SDK_INT
<
23
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -445,7 +452,7 @@ public final class DashStreamingTest {
...
@@ -445,7 +452,7 @@ public final class DashStreamingTest {
@Test
@Test
public
void
widevineH265AdaptiveV24
()
throws
Exception
{
public
void
widevineH265AdaptiveV24
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
24
)
{
if
(
Util
.
SDK_INT
<
24
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -462,7 +469,7 @@ public final class DashStreamingTest {
...
@@ -462,7 +469,7 @@ public final class DashStreamingTest {
@Test
@Test
public
void
widevineH265AdaptiveWithSeekingV24
()
throws
Exception
{
public
void
widevineH265AdaptiveWithSeekingV24
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
24
)
{
if
(
Util
.
SDK_INT
<
24
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -480,7 +487,7 @@ public final class DashStreamingTest {
...
@@ -480,7 +487,7 @@ public final class DashStreamingTest {
@Test
@Test
public
void
widevineH265AdaptiveWithRendererDisablingV24
()
throws
Exception
{
public
void
widevineH265AdaptiveWithRendererDisablingV24
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
24
)
{
if
(
Util
.
SDK_INT
<
24
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -500,7 +507,7 @@ public final class DashStreamingTest {
...
@@ -500,7 +507,7 @@ public final class DashStreamingTest {
@Test
@Test
public
void
widevineVp9Fixed360pV23
()
throws
Exception
{
public
void
widevineVp9Fixed360pV23
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
23
)
{
if
(
Util
.
SDK_INT
<
23
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -517,7 +524,7 @@ public final class DashStreamingTest {
...
@@ -517,7 +524,7 @@ public final class DashStreamingTest {
@Test
@Test
public
void
widevineVp9AdaptiveV24
()
throws
Exception
{
public
void
widevineVp9AdaptiveV24
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
24
)
{
if
(
Util
.
SDK_INT
<
24
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -534,7 +541,7 @@ public final class DashStreamingTest {
...
@@ -534,7 +541,7 @@ public final class DashStreamingTest {
@Test
@Test
public
void
widevineVp9AdaptiveWithSeekingV24
()
throws
Exception
{
public
void
widevineVp9AdaptiveWithSeekingV24
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
24
)
{
if
(
Util
.
SDK_INT
<
24
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -552,7 +559,7 @@ public final class DashStreamingTest {
...
@@ -552,7 +559,7 @@ public final class DashStreamingTest {
@Test
@Test
public
void
widevineVp9AdaptiveWithRendererDisablingV24
()
throws
Exception
{
public
void
widevineVp9AdaptiveWithRendererDisablingV24
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
24
)
{
if
(
Util
.
SDK_INT
<
24
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -573,7 +580,7 @@ public final class DashStreamingTest {
...
@@ -573,7 +580,7 @@ public final class DashStreamingTest {
// 23.976 fps.
// 23.976 fps.
@Test
@Test
public
void
widevine23FpsH264FixedV23
()
throws
Exception
{
public
void
widevine23FpsH264FixedV23
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
23
)
{
if
(
Util
.
SDK_INT
<
23
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -591,7 +598,7 @@ public final class DashStreamingTest {
...
@@ -591,7 +598,7 @@ public final class DashStreamingTest {
// 24 fps.
// 24 fps.
@Test
@Test
public
void
widevine24FpsH264FixedV23
()
throws
Exception
{
public
void
widevine24FpsH264FixedV23
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
23
)
{
if
(
Util
.
SDK_INT
<
23
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
// Pass.
// Pass.
return
;
return
;
}
}
...
@@ -609,7 +616,7 @@ public final class DashStreamingTest {
...
@@ -609,7 +616,7 @@ public final class DashStreamingTest {
// 29.97 fps.
// 29.97 fps.
@Test
@Test
public
void
widevine29FpsH264FixedV23
()
throws
Exception
{
public
void
widevine29FpsH264FixedV23
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
23
)
{
if
(
Util
.
SDK_INT
<
23
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
// Pass.
// Pass.
return
;
return
;
}
}
...
...
playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/DashWidevineOfflineTest.java
View file @
3af82b2a
...
@@ -100,7 +100,7 @@ public final class DashWidevineOfflineTest {
...
@@ -100,7 +100,7 @@ public final class DashWidevineOfflineTest {
@Test
@Test
public
void
widevineOfflineLicenseV22
()
throws
Exception
{
public
void
widevineOfflineLicenseV22
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
22
)
{
if
(
Util
.
SDK_INT
<
22
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
return
;
// Pass.
return
;
// Pass.
}
}
downloadLicense
();
downloadLicense
();
...
@@ -113,7 +113,9 @@ public final class DashWidevineOfflineTest {
...
@@ -113,7 +113,9 @@ public final class DashWidevineOfflineTest {
@Test
@Test
public
void
widevineOfflineReleasedLicenseV22
()
throws
Throwable
{
public
void
widevineOfflineReleasedLicenseV22
()
throws
Throwable
{
if
(
Util
.
SDK_INT
<
22
||
Util
.
SDK_INT
>
28
)
{
if
(
Util
.
SDK_INT
<
22
||
Util
.
SDK_INT
>
28
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
()))
{
return
;
// Pass.
return
;
// Pass.
}
}
downloadLicense
();
downloadLicense
();
...
@@ -136,7 +138,7 @@ public final class DashWidevineOfflineTest {
...
@@ -136,7 +138,7 @@ public final class DashWidevineOfflineTest {
@Test
@Test
public
void
widevineOfflineReleasedLicenseV29
()
throws
Throwable
{
public
void
widevineOfflineReleasedLicenseV29
()
throws
Throwable
{
if
(
Util
.
SDK_INT
<
29
)
{
if
(
Util
.
SDK_INT
<
29
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
return
;
// Pass.
return
;
// Pass.
}
}
downloadLicense
();
downloadLicense
();
...
@@ -158,7 +160,7 @@ public final class DashWidevineOfflineTest {
...
@@ -158,7 +160,7 @@ public final class DashWidevineOfflineTest {
@Test
@Test
public
void
widevineOfflineExpiredLicenseV22
()
throws
Exception
{
public
void
widevineOfflineExpiredLicenseV22
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
22
)
{
if
(
Util
.
SDK_INT
<
22
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
return
;
// Pass.
return
;
// Pass.
}
}
downloadLicense
();
downloadLicense
();
...
@@ -188,7 +190,7 @@ public final class DashWidevineOfflineTest {
...
@@ -188,7 +190,7 @@ public final class DashWidevineOfflineTest {
@Test
@Test
public
void
widevineOfflineLicenseExpiresOnPauseV22
()
throws
Exception
{
public
void
widevineOfflineLicenseExpiresOnPauseV22
()
throws
Exception
{
if
(
Util
.
SDK_INT
<
22
)
{
if
(
Util
.
SDK_INT
<
22
||
GtsTestUtil
.
shouldSkipWidevineTest
(
testRule
.
getActivity
())
)
{
return
;
// Pass.
return
;
// Pass.
}
}
downloadLicense
();
downloadLicense
();
...
@@ -198,7 +200,7 @@ public final class DashWidevineOfflineTest {
...
@@ -198,7 +200,7 @@ public final class DashWidevineOfflineTest {
offlineLicenseHelper
.
getLicenseDurationRemainingSec
(
offlineLicenseKeySetId
);
offlineLicenseHelper
.
getLicenseDurationRemainingSec
(
offlineLicenseKeySetId
);
long
licenseDuration
=
licenseDurationRemainingSec
.
first
;
long
licenseDuration
=
licenseDurationRemainingSec
.
first
;
assertWithMessage
(
assertWithMessage
(
"License duration should be less than 30 sec.
"
+
"
Server settings might have changed."
)
"License duration should be less than 30 sec. Server settings might have changed."
)
.
that
(
licenseDuration
<
30
)
.
that
(
licenseDuration
<
30
)
.
isTrue
();
.
isTrue
();
ActionSchedule
schedule
=
new
ActionSchedule
.
Builder
(
TAG
)
ActionSchedule
schedule
=
new
ActionSchedule
.
Builder
(
TAG
)
...
...
playbacktests/src/androidTest/java/com/google/android/exoplayer2/playbacktests/gts/GtsTestUtil.java
0 → 100644
View file @
3af82b2a
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
playbacktests
.
gts
;
import
static
com
.
google
.
android
.
exoplayer2
.
C
.
WIDEVINE_UUID
;
import
android.content.Context
;
import
android.content.pm.PackageManager
;
import
android.media.MediaDrm
;
/** Utility methods for GTS tests. */
public
final
class
GtsTestUtil
{
private
GtsTestUtil
()
{}
/** Returns true if the device doesn't support Widevine and this is permitted. */
public
static
boolean
shouldSkipWidevineTest
(
Context
context
)
{
if
(
isGmsInstalled
(
context
))
{
// GMS devices are required to support Widevine.
return
false
;
}
// For non-GMS devices Widevine is optional.
return
!
MediaDrm
.
isCryptoSchemeSupported
(
WIDEVINE_UUID
);
}
private
static
boolean
isGmsInstalled
(
Context
context
)
{
try
{
context
.
getPackageManager
()
.
getPackageInfo
(
"com.google.android.gms"
,
PackageManager
.
GET_SIGNATURES
);
}
catch
(
PackageManager
.
NameNotFoundException
e
)
{
return
false
;
}
return
true
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment