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

Commit 54b16b09 authored by Pablo Gamito's avatar Pablo Gamito Committed by Android (Google) Code Review
Browse files

Merge "Remove distinction between test and transition setup/teardown"

parents 055496f5 3e1c6631
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -68,10 +68,8 @@ abstract class BaseTest @JvmOverloads constructor(
    fun buildFlicker(): FlickerBuilder {
        return FlickerBuilder(instrumentation).apply {
            setup {
                test {
                testSpec.setIsTablet(wmHelper.currentState.wmState.isTablet)
            }
            }
            transition()
        }
    }
+8 −12
Original line number Diff line number Diff line
@@ -55,22 +55,18 @@ abstract class BaseBubbleScreen(
    ): FlickerBuilder.() -> Unit {
        return {
            setup {
                test {
                notifyManager.setBubblesAllowed(testApp.`package`,
                    uid, NotificationManager.BUBBLE_PREFERENCE_ALL)
                testApp.launchViaIntent(wmHelper)
                waitAndGetAddBubbleBtn()
                waitAndGetCancelAllBtn()
            }
            }

            teardown {
                test {
                notifyManager.setBubblesAllowed(testApp.`package`,
                    uid, NotificationManager.BUBBLE_PREFERENCE_NONE)
                testApp.exit()
            }
            }

            extraSpec(this)
        }
+2 −4
Original line number Diff line number Diff line
@@ -54,11 +54,9 @@ open class DismissBubbleScreen(testSpec: FlickerTestParameter) : BaseBubbleScree
    override val transition: FlickerBuilder.() -> Unit
        get() = buildTransition {
            setup {
                eachRun {
                val addBubbleBtn = waitAndGetAddBubbleBtn()
                addBubbleBtn?.click() ?: error("Add Bubble not found")
            }
            }
            transitions {
                wm.run { wm.defaultDisplay.getMetrics(displaySize) }
                val dist = Point((displaySize.widthPixels / 2), displaySize.heightPixels)
+2 −4
Original line number Diff line number Diff line
@@ -48,11 +48,9 @@ open class ExpandBubbleScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen
    override val transition: FlickerBuilder.() -> Unit
        get() = buildTransition {
            setup {
                test {
                val addBubbleBtn = waitAndGetAddBubbleBtn()
                addBubbleBtn?.click() ?: error("Add Bubble not found")
            }
            }
            transitions {
                val showBubble = device.wait(
                    Until.findObject(
+7 −9
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ class LaunchBubbleFromLockScreen(testSpec: FlickerTestParameter) : BaseBubbleScr
    override val transition: FlickerBuilder.() -> Unit
        get() = buildTransition {
            setup {
                eachRun {
                val addBubbleBtn = waitAndGetAddBubbleBtn()
                addBubbleBtn?.click() ?: error("Bubble widget not found")
                device.sleep()
@@ -58,7 +57,6 @@ class LaunchBubbleFromLockScreen(testSpec: FlickerTestParameter) : BaseBubbleScr
                    .waitForAndVerify()
                device.wakeUp()
            }
            }
            transitions {
                // Swipe & wait for the notification shade to expand so all can be seen
                val wm = context.getSystemService(WindowManager::class.java)
Loading