Merge "Replace Log.wtf with an exception in MediaCarouselController." into tm-qpr-dev
This commit is contained in:
@@ -610,7 +610,11 @@ constructor(
|
||||
// are
|
||||
// elements in mediaPlayers.
|
||||
if (MediaPlayerData.players().size != mediaContent.childCount) {
|
||||
Log.wtf(TAG, "Size of players list and number of views in carousel are out of sync")
|
||||
throw IllegalStateException(
|
||||
"Size of players list and number of views in carousel are out of sync. " +
|
||||
"Players size is ${MediaPlayerData.players().size}. " +
|
||||
"View count is ${mediaContent.childCount}."
|
||||
)
|
||||
}
|
||||
return existingPlayer == null
|
||||
}
|
||||
@@ -667,7 +671,11 @@ constructor(
|
||||
// are
|
||||
// elements in mediaPlayers.
|
||||
if (MediaPlayerData.players().size != mediaContent.childCount) {
|
||||
Log.wtf(TAG, "Size of players list and number of views in carousel are out of sync")
|
||||
throw IllegalStateException(
|
||||
"Size of players list and number of views in carousel are out of sync. " +
|
||||
"Players size is ${MediaPlayerData.players().size}. " +
|
||||
"View count is ${mediaContent.childCount}."
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ import javax.inject.Provider
|
||||
import junit.framework.Assert.assertEquals
|
||||
import junit.framework.Assert.assertTrue
|
||||
import org.junit.Before
|
||||
import org.junit.Ignore
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentCaptor
|
||||
@@ -119,6 +120,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
MediaPlayerData.clear()
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testPlayerOrdering() {
|
||||
// Test values: key, data, last active time
|
||||
@@ -295,6 +297,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
}
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testOrderWithSmartspace_prioritized() {
|
||||
testPlayerOrdering()
|
||||
@@ -312,6 +315,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
assertTrue(MediaPlayerData.playerKeys().elementAt(2).isSsMediaRec)
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testOrderWithSmartspace_prioritized_updatingVisibleMediaPlayers() {
|
||||
testPlayerOrdering()
|
||||
@@ -328,6 +332,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
assertTrue(MediaPlayerData.visiblePlayerKeys().elementAt(2).isSsMediaRec)
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testOrderWithSmartspace_notPrioritized() {
|
||||
testPlayerOrdering()
|
||||
@@ -346,6 +351,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
assertTrue(MediaPlayerData.playerKeys().elementAt(idx).isSsMediaRec)
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testPlayingExistingMediaPlayerFromCarousel_visibleMediaPlayersNotUpdated() {
|
||||
testPlayerOrdering()
|
||||
@@ -382,6 +388,8 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
MediaPlayerData.playerKeys().elementAt(0)
|
||||
)
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testSwipeDismiss_logged() {
|
||||
mediaCarouselController.mediaCarouselScrollHandler.dismissCallback.invoke()
|
||||
@@ -389,6 +397,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
verify(logger).logSwipeDismiss()
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testSettingsButton_logged() {
|
||||
mediaCarouselController.settingsButton.callOnClick()
|
||||
@@ -396,6 +405,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
verify(logger).logCarouselSettings()
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testLocationChangeQs_logged() {
|
||||
mediaCarouselController.onDesiredLocationChanged(
|
||||
@@ -406,6 +416,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
verify(logger).logCarouselPosition(MediaHierarchyManager.LOCATION_QS)
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testLocationChangeQqs_logged() {
|
||||
mediaCarouselController.onDesiredLocationChanged(
|
||||
@@ -416,6 +427,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
verify(logger).logCarouselPosition(MediaHierarchyManager.LOCATION_QQS)
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testLocationChangeLockscreen_logged() {
|
||||
mediaCarouselController.onDesiredLocationChanged(
|
||||
@@ -426,6 +438,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
verify(logger).logCarouselPosition(MediaHierarchyManager.LOCATION_LOCKSCREEN)
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testLocationChangeDream_logged() {
|
||||
mediaCarouselController.onDesiredLocationChanged(
|
||||
@@ -436,6 +449,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
verify(logger).logCarouselPosition(MediaHierarchyManager.LOCATION_DREAM_OVERLAY)
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testRecommendationRemoved_logged() {
|
||||
val packageName = "smartspace package"
|
||||
@@ -449,6 +463,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
verify(logger).logRecommendationRemoved(eq(packageName), eq(instanceId!!))
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testMediaLoaded_ScrollToActivePlayer() {
|
||||
listener.value.onMediaDataLoaded(
|
||||
@@ -506,6 +521,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
)
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testMediaLoadedFromRecommendationCard_ScrollToActivePlayer() {
|
||||
listener.value.onSmartspaceMediaDataLoaded(
|
||||
@@ -549,6 +565,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
assertEquals(playerIndex, 0)
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testRecommendationRemovedWhileNotVisible_updateHostVisibility() {
|
||||
var result = false
|
||||
@@ -560,6 +577,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
assertEquals(true, result)
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testRecommendationRemovedWhileVisible_thenReorders_updateHostVisibility() {
|
||||
var result = false
|
||||
@@ -573,6 +591,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
assertEquals(true, result)
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testGetCurrentVisibleMediaContentIntent() {
|
||||
val clickIntent1 = mock(PendingIntent::class.java)
|
||||
@@ -619,6 +638,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
|
||||
assertEquals(mediaCarouselController.getCurrentVisibleMediaContentIntent(), clickIntent2)
|
||||
}
|
||||
|
||||
@Ignore("b/253229241")
|
||||
@Test
|
||||
fun testSetCurrentState_UpdatePageIndicatorAlphaWhenSquish() {
|
||||
val delta = 0.0001F
|
||||
|
||||
Reference in New Issue
Block a user