Skip to content

Commit

Permalink
test: Skip offline DRM tests on Android (#6573)
Browse files Browse the repository at this point in the history
The offline DRM tests have begun failing on Android at a rate of 80% or
more. This was eventually determined to be related to
https://crbug.com/1108158 and the timeout workaround in DrmEngine.

When close() hangs and we time out and move on, we leave sessions open
that consume hardware resources at the OEMCrypto level in Android. This
eventually leads to failures like `Failed to execute 'createMediaKeys'
on 'MediaKeySystemAccess': MediaDrmBridge creation failed`. Logs from
`adb logcat` show that 17 sessions are open when this fails, which
likely means our lab device has a limit of 16 open sessions.

Initially, delays between these offline DRM test cases were found to be
an effective workaround, but full test runs showed this to be
ineffective after all.

The only recourse, until Chrome and Widevine fix their bug, is to skip
these tests on Android.
  • Loading branch information
joeyparrish committed May 10, 2024
1 parent 43f275b commit 91daf87
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions test/offline/offline_integration.js
Expand Up @@ -19,10 +19,18 @@ filterDescribe('Offline', supportsStorage, () => {
let eventManager;
/** @type {shaka.test.Waiter} */
let waiter;
/** @type {?shaka.extern.DrmSupportType} */
let widevineSupport;
/** @type {?shaka.extern.DrmSupportType} */
let playreadySupport;

beforeAll(() => {
beforeAll(async () => {
video = shaka.test.UiUtils.createVideoElement();
document.body.appendChild(video);

const support = await shaka.Player.probeSupport();
widevineSupport = support.drm['com.widevine.alpha'];
playreadySupport = support.drm['com.microsoft.playready'];
});

afterAll(() => {
Expand Down Expand Up @@ -81,13 +89,14 @@ filterDescribe('Offline', supportsStorage, () => {
drmIt(
'stores, plays, and deletes protected content with a persistent license',
async () => {
const support = await shaka.Player.probeSupport();
const widevineSupport = support.drm['com.widevine.alpha'];

if (!widevineSupport || !widevineSupport.persistentState) {
pending('Widevine persistent licenses are not supported');
return;
}
if (shaka.util.Platform.isAndroid()) {
pending('Skipping offline DRM tests on Android - crbug.com/1108158');
return;
}

shaka.test.TestScheme.setupPlayer(player, 'sintel-enc');

Expand Down Expand Up @@ -116,14 +125,14 @@ filterDescribe('Offline', supportsStorage, () => {
drmIt(
'stores, plays, and deletes protected content with a temporary license',
async () => {
const support = await shaka.Player.probeSupport();
const widevineSupport = support.drm['com.widevine.alpha'];
const playreadySupport = support.drm['com.microsoft.playready'];

if (!(widevineSupport || playreadySupport)) {
pending('Widevine and PlayReady are not supported');
return;
}
if (shaka.util.Platform.isAndroid()) {
pending('Skipping offline DRM tests on Android - crbug.com/1108158');
return;
}

if (shaka.util.Platform.isXboxOne()) {
// Axinom won't issue a license for an Xbox One. The error message
Expand Down

0 comments on commit 91daf87

Please sign in to comment.