Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae7eddb6 authored by Liran Binyamin's avatar Liran Binyamin
Browse files

Refactor bubble access to package manager

Bubbles use package manager to resolve app info, which causes
test failures in robolectric. This change refactors this logic
to allow us to use a fake for testing.

Bug: 416801340
Flag: EXEMPT refactor to fix test failure
Test: atest BubbleControllerTest
Change-Id: I854f2a0c6cf637ef9a3de024e3d09e1c650d5e5b
parent 921f2de4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
sdk=NEWEST_SDK
graphicsMode=NATIVE
+1 −0
Original line number Diff line number Diff line
@@ -487,6 +487,7 @@ class BubbleControllerBubbleBarTest {
            mock<IWindowManager>(),
            BubbleResizabilityChecker(),
            HomeIntentProvider(context),
            FakeBubbleAppInfoProvider(),
        )
    }

+1 −0
Original line number Diff line number Diff line
@@ -456,6 +456,7 @@ class BubbleControllerTest(flags: FlagsParameterization) {
                mock<IWindowManager>(),
                resizeChecker,
                HomeIntentProvider(context),
                FakeBubbleAppInfoProvider(),
            )
        bubbleController.setInflateSynchronously(true)
        bubbleController.onInit()
+1 −0
Original line number Diff line number Diff line
@@ -756,6 +756,7 @@ class BubbleStackViewTest {
            bubbleStackView,
            null,
            iconFactory,
            FakeBubbleAppInfoProvider(),
            false
        )

+5 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ class BubbleViewInfoTaskTest {
    private lateinit var bubblePositioner: BubblePositioner
    private lateinit var bubbleLogger: BubbleLogger
    private lateinit var expandedViewManager: BubbleExpandedViewManager
    private lateinit var appInfoProvider: FakeBubbleAppInfoProvider

    private val bubbleTaskViewFactory = BubbleTaskViewFactory {
        BubbleTaskView(mock<TaskView>(), directExecutor())
@@ -130,6 +131,8 @@ class BubbleViewInfoTaskTest {
                BubblePersistentRepository(context)
            )

        appInfoProvider = FakeBubbleAppInfoProvider()

        bubbleController =
            BubbleController(
                context,
@@ -163,6 +166,7 @@ class BubbleViewInfoTaskTest {
                mock<IWindowManager>(),
                BubbleResizabilityChecker(),
                HomeIntentProvider(context),
                appInfoProvider,
            )

        // TODO: (b/371829099) - when optional overflow is no longer flagged we can enable this
@@ -332,6 +336,7 @@ class BubbleViewInfoTaskTest {
            bubbleStackView,
            null /* layerView */,
            iconFactory,
            appInfoProvider,
            false /* skipInflation */,
            callback,
            mainExecutor,
Loading