Skip to content

Commit

Permalink
test: Disable codec switch smooth test if changeType() is unavailable (
Browse files Browse the repository at this point in the history
…#7410)

Previously we were disabling tests only by using
`supportsSmoothCodecSwitching()` method, but it checks only user agent
and not API existence.
  • Loading branch information
tykus160 authored Oct 10, 2024
1 parent 51d00b8 commit 16753e7
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions test/codec_switching/codec_switching_integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ describe('Codec Switching', () => {
});

it('can switch codecs SMOOTH', async () => {
if (!shaka.media.Capabilities.isChangeTypeSupported()) {
pending('SourceBuffer.changeType is not supported');
}
if (!shaka.util.Platform.supportsSmoothCodecSwitching()) {
pending('Mediasource.ChangeType is not considered ' +
pending('SourceBuffer.changeType is not considered ' +
'reliable on this device');
}
if (!await Util.isTypeSupported('audio/webm; codecs="opus"')) {
Expand Down Expand Up @@ -160,8 +163,11 @@ describe('Codec Switching', () => {
});

it('can switch codecs SMOOTH', async () => {
if (!shaka.media.Capabilities.isChangeTypeSupported()) {
pending('SourceBuffer.changeType is not supported');
}
if (!shaka.util.Platform.supportsSmoothCodecSwitching()) {
pending('Mediasource.ChangeType is not considered ' +
pending('SourceBuffer.changeType is not considered ' +
'reliable on this device');
}
if (!await Util.isTypeSupported('audio/webm; codecs="opus"')) {
Expand Down Expand Up @@ -229,8 +235,11 @@ describe('Codec Switching', () => {
});

it('can switch codecs SMOOTH', async () => {
if (!shaka.media.Capabilities.isChangeTypeSupported()) {
pending('SourceBuffer.changeType is not supported');
}
if (!shaka.util.Platform.supportsSmoothCodecSwitching()) {
pending('Mediasource.ChangeType is not considered ' +
pending('SourceBuffer.changeType is not considered ' +
'reliable on this device');
}
if (!await Util.isTypeSupported('audio/mp4; codecs="ec-3"')) {
Expand Down Expand Up @@ -299,8 +308,11 @@ describe('Codec Switching', () => {
});

it('can switch codecs SMOOTH', async () => {
if (!shaka.media.Capabilities.isChangeTypeSupported()) {
pending('SourceBuffer.changeType is not supported');
}
if (!shaka.util.Platform.supportsSmoothCodecSwitching()) {
pending('Mediasource.ChangeType is not considered ' +
pending('SourceBuffer.changeType is not considered ' +
'reliable on this device');
}
if (!await Util.isTypeSupported('audio/mp4; codecs="ec-3"')) {
Expand Down

0 comments on commit 16753e7

Please sign in to comment.