Skip to content

Commit

Permalink
chore: Remove IMA tests (#7461)
Browse files Browse the repository at this point in the history
Since our tests already test VAST and VMAP this is no longer necessary,
and the tests were disabled because the IMA library is buggy in Tizen.
On the other hand, removing the IMA load reduces the test loading time.
  • Loading branch information
avelad authored Oct 21, 2024
1 parent 04a39aa commit 9de2aac
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 126 deletions.
95 changes: 0 additions & 95 deletions test/ads_integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,101 +104,6 @@ describe('Ads', () => {
document.body.removeChild(adContainer);
});

// IMA tests are failing in GitHub Actions
xdescribe('supports IMA SDK with vast', () => {
/** @type {string} */
const streamUri = '/base/test/test/assets/dash-multi-codec/dash.mpd';

it('with support for multiple media elements', async () => {
if (shaka.util.Platform.isSmartTV()) {
pending('Platform without support for multiple media elements.');
}
player.configure('ads.customPlayheadTracker', false);
player.configure('ads.skipPlayDetection', false);
player.configure('ads.supportsMultipleMediaElements', true);

adManager.initClientSide(
adContainer, video, /** adsRenderingSettings= **/ null);

await player.load(streamUri);
await video.play();
expect(player.isLive()).toBe(false);

// Wait for the video to start playback. If it takes longer than 10
// seconds, fail the test.
await waiter.waitForMovementOrFailOnTimeout(video, 10);

// Play for 5 seconds, but stop early if the video ends. If it takes
// longer than 20 seconds, fail the test.
await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 5, 20);

const adRequest = new google.ima.AdsRequest();
adRequest.adTagUrl = vastUri;
adManager.requestClientSideAds(adRequest);

// Wait a maximum of 10 seconds before the ad starts playing.
await waiter.timeoutAfter(10)
.waitForEvent(adManager, shaka.ads.Utils.AD_STARTED);
await waiter.timeoutAfter(10)
.waitForEvent(adManager, shaka.ads.Utils.AD_FIRST_QUARTILE);
await waiter.timeoutAfter(10)
.waitForEvent(adManager, shaka.ads.Utils.AD_MIDPOINT);
await waiter.timeoutAfter(10)
.waitForEvent(adManager, shaka.ads.Utils.AD_THIRD_QUARTILE);
await waiter.timeoutAfter(10)
.waitForEvent(adManager, shaka.ads.Utils.AD_STOPPED);

// Play for 10 seconds, but stop early if the video ends. If it takes
// longer than 30 seconds, fail the test.
await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 10, 30);

await player.unload();
});

it('without support for multiple media elements', async () => {
player.configure('ads.customPlayheadTracker', true);
player.configure('ads.skipPlayDetection', true);
player.configure('ads.supportsMultipleMediaElements', false);

adManager.initClientSide(
adContainer, video, /** adsRenderingSettings= **/ null);

await player.load(streamUri);
await video.play();
expect(player.isLive()).toBe(false);

// Wait for the video to start playback. If it takes longer than 10
// seconds, fail the test.
await waiter.waitForMovementOrFailOnTimeout(video, 10);

// Play for 5 seconds, but stop early if the video ends. If it takes
// longer than 20 seconds, fail the test.
await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 5, 20);

const adRequest = new google.ima.AdsRequest();
adRequest.adTagUrl = vastUri;
adManager.requestClientSideAds(adRequest);

// Wait a maximum of 10 seconds before the ad starts playing.
await waiter.timeoutAfter(10)
.waitForEvent(adManager, shaka.ads.Utils.AD_STARTED);
await waiter.timeoutAfter(10)
.waitForEvent(adManager, shaka.ads.Utils.AD_FIRST_QUARTILE);
await waiter.timeoutAfter(10)
.waitForEvent(adManager, shaka.ads.Utils.AD_MIDPOINT);
await waiter.timeoutAfter(10)
.waitForEvent(adManager, shaka.ads.Utils.AD_THIRD_QUARTILE);
await waiter.timeoutAfter(10)
.waitForEvent(adManager, shaka.ads.Utils.AD_STOPPED);

// Play for 10 seconds, but stop early if the video ends. If it takes
// longer than 30 seconds, fail the test.
await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 10, 30);

await player.unload();
});
});

describe('support HLS Interstitials', () => {
/** @type {string} */
const streamUri = '/base/test/test/assets/hls-interstitial/main.m3u8';
Expand Down
31 changes: 0 additions & 31 deletions test/test/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,34 +432,6 @@ function configureJasmineEnvironment() {
};
}

async function loadImaScript() {
await new Promise((resolve, reject) => {
const script = /** @type {!HTMLScriptElement} */(
document.createElement('script'));
script.defer = false;
script['async'] = false;
script.onload = resolve;
script.onerror = reject;
script.setAttribute('src',
'https://imasdk.googleapis.com/js/sdkloader/ima3.js');
document.head.appendChild(script);
});
}

async function loadDaiScript() {
await new Promise((resolve, reject) => {
const script = /** @type {!HTMLScriptElement} */(
document.createElement('script'));
script.defer = false;
script['async'] = false;
script.onload = resolve;
script.onerror = reject;
script.setAttribute('src',
'https://imasdk.googleapis.com/js/sdkloader/ima3_dai.js');
document.head.appendChild(script);
});
}

async function checkSupport() {
try {
const startMs = Date.now();
Expand All @@ -485,9 +457,6 @@ async function setupTestEnvironment() {
disableScrollbars();
workAroundLegacyEdgePromiseIssues();

await loadImaScript();
await loadDaiScript();

// The spec filter callback occurs before calls to beforeAll, so we need to
// install polyfills here to ensure that browser support is correctly
// detected.
Expand Down

0 comments on commit 9de2aac

Please sign in to comment.