From 6dbe016cfe573936812614415bc463cd14d0fb9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Fri, 21 Jun 2024 16:43:09 +0200 Subject: [PATCH 1/2] Fix: use `runUntilPendingCommandsAreFullyHandled` in CommandersActTrackerIntegrationTest This commit replaces `playUntilStartOfMediaItem` with `run UntilPendingCommandsAreFullyHandled` in the CommandersActTrackerIntegrationTest. --- .../CommandersActTrackerIntegrationTest.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pillarbox-core-business/src/test/java/ch/srgssr/pillarbox/core/business/tracker/commandersact/CommandersActTrackerIntegrationTest.kt b/pillarbox-core-business/src/test/java/ch/srgssr/pillarbox/core/business/tracker/commandersact/CommandersActTrackerIntegrationTest.kt index bed96623c..a4ccca3b3 100644 --- a/pillarbox-core-business/src/test/java/ch/srgssr/pillarbox/core/business/tracker/commandersact/CommandersActTrackerIntegrationTest.kt +++ b/pillarbox-core-business/src/test/java/ch/srgssr/pillarbox/core/business/tracker/commandersact/CommandersActTrackerIntegrationTest.kt @@ -122,7 +122,7 @@ class CommandersActTrackerIntegrationTest { player.playWhenReady = true TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY) - TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0) + TestPlayerRunHelper.runUntilPendingCommandsAreFullyHandled(player) player.setMediaItem(SRGMediaItemBuilder(URN_NOT_LIVE_VIDEO).build()) player.playWhenReady = true @@ -214,7 +214,7 @@ class CommandersActTrackerIntegrationTest { player.playWhenReady = true TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY) - TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0) + TestPlayerRunHelper.runUntilPendingCommandsAreFullyHandled(player) verifyOrder { commandersAct.enableRunningInBackground() @@ -239,7 +239,7 @@ class CommandersActTrackerIntegrationTest { player.setPlaybackSpeed(2f) TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY) - TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0) + TestPlayerRunHelper.runUntilPendingCommandsAreFullyHandled(player) verifyOrder { commandersAct.enableRunningInBackground() @@ -263,7 +263,7 @@ class CommandersActTrackerIntegrationTest { player.playWhenReady = true TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY) - TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0) + TestPlayerRunHelper.runUntilPendingCommandsAreFullyHandled(player) clock.advanceTime(5.minutes.inWholeMilliseconds) player.setPlaybackSpeed(2f) @@ -292,7 +292,7 @@ class CommandersActTrackerIntegrationTest { player.playWhenReady = true TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY) - TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0) + TestPlayerRunHelper.runUntilPendingCommandsAreFullyHandled(player) clock.advanceTime(2.minutes.inWholeMilliseconds) player.playWhenReady = false @@ -327,7 +327,7 @@ class CommandersActTrackerIntegrationTest { player.playWhenReady = true TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY) - TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0) + TestPlayerRunHelper.runUntilPendingCommandsAreFullyHandled(player) clock.advanceTime(2.minutes.inWholeMilliseconds) player.playWhenReady = false @@ -373,7 +373,7 @@ class CommandersActTrackerIntegrationTest { player.playWhenReady = true TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY) - TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0) + TestPlayerRunHelper.runUntilPendingCommandsAreFullyHandled(player) clock.advanceTime(2.minutes.inWholeMilliseconds) player.stop() @@ -621,7 +621,7 @@ class CommandersActTrackerIntegrationTest { player.playWhenReady = true TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY) - TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0) + TestPlayerRunHelper.runUntilPendingCommandsAreFullyHandled(player) clock.advanceTime(playTime.inWholeMilliseconds) advanceTimeBy(playTime) From 2101a580e9b519da7cbfe2bd736afabf05f805c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Fri, 21 Jun 2024 16:43:55 +0200 Subject: [PATCH 2/2] Enable ComScore integration tests for live content This commit removes the `@Ignore` annotations from the ComScore integration tests for live content, enabling them to run as part of the test suite. This assumes that a live DVR is now available outside of Switzerland for testing purposes. --- .../business/tracker/comscore/ComScoreTrackerIntegrationTest.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/pillarbox-core-business/src/test/java/ch/srgssr/pillarbox/core/business/tracker/comscore/ComScoreTrackerIntegrationTest.kt b/pillarbox-core-business/src/test/java/ch/srgssr/pillarbox/core/business/tracker/comscore/ComScoreTrackerIntegrationTest.kt index 6b950afba..e831cf9be 100644 --- a/pillarbox-core-business/src/test/java/ch/srgssr/pillarbox/core/business/tracker/comscore/ComScoreTrackerIntegrationTest.kt +++ b/pillarbox-core-business/src/test/java/ch/srgssr/pillarbox/core/business/tracker/comscore/ComScoreTrackerIntegrationTest.kt @@ -359,7 +359,6 @@ class ComScoreTrackerIntegrationTest { } @Test - @Ignore("Need a live DVR available outside of Switzerland") fun `live - player prepared, playing and seeking`() { player.setMediaItem(SRGMediaItemBuilder(URN_LIVE_VIDEO).build()) player.prepare() @@ -391,7 +390,6 @@ class ComScoreTrackerIntegrationTest { } @Test - @Ignore("Need a live DVR available outside of Switzerland") fun `live - player prepared and seek`() { player.setMediaItem(SRGMediaItemBuilder(URN_LIVE_VIDEO).build()) player.prepare()