Skip to content

Commit

Permalink
test(Ads): Test quartile interstitials events (#7688)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored Nov 28, 2024
1 parent 7be22db commit ed13c8b
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions test/ads_integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ describe('Ads', () => {
// 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(20)
.waitForEvent(adManager, shaka.ads.Utils.AD_STOPPED);

Expand All @@ -118,6 +124,12 @@ describe('Ads', () => {
// 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(20)
.waitForEvent(adManager, shaka.ads.Utils.AD_STOPPED);

Expand All @@ -140,6 +152,12 @@ describe('Ads', () => {
// 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(20)
.waitForEvent(adManager, shaka.ads.Utils.AD_STOPPED);

Expand All @@ -149,6 +167,12 @@ describe('Ads', () => {
// 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(20)
.waitForEvent(adManager, shaka.ads.Utils.AD_STOPPED);

Expand All @@ -169,6 +193,12 @@ describe('Ads', () => {
// 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(20)
.waitForEvent(adManager, shaka.ads.Utils.AD_STOPPED);

Expand All @@ -178,6 +208,12 @@ describe('Ads', () => {
// 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(20)
.waitForEvent(adManager, shaka.ads.Utils.AD_STOPPED);

Expand Down Expand Up @@ -205,6 +241,12 @@ describe('Ads', () => {
// 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(20)
.waitForEvent(adManager, shaka.ads.Utils.AD_STOPPED);

Expand Down

0 comments on commit ed13c8b

Please sign in to comment.