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

Commit de499f5c authored by Charles Chen's avatar Charles Chen
Browse files

Move nav parameters to tests

... to make the test configuration more visible.

More background is here:
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/34704361/comment/77f2b6ff_029cf8b9/

Test: build
Bug: 396020056
Flag: TEST_ONLYi

Change-Id: Ic5316697e06a32ea9975ca551269f8735bcff444
parent 61cab1fb
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -36,7 +36,9 @@ import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.junit.runners.Parameterized

/**
 * Test clicking bubble to expand a bubble that was in collapsed state.
@@ -62,6 +64,7 @@ import org.junit.runners.MethodSorters
@RequiresDevice
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Presubmit
@RunWith(Parameterized::class)
class BubbleBarMovesTest(navBar: NavBar) : BubbleFlickerTestBase(), ExpandBubbleTestCases {
    companion object : FlickerPropertyInitializer() {

@@ -85,6 +88,10 @@ class BubbleBarMovesTest(navBar: NavBar) : BubbleFlickerTestBase(), ExpandBubble
            },
            tearDownAfterTransition = { testApp.exit(wmHelper) }
        )

        @Parameterized.Parameters(name = "{0}")
        @JvmStatic
        fun data(): List<NavBar> = listOf(NavBar.MODE_GESTURAL, NavBar.MODE_3BUTTON)
    }

    @get:Rule
+1 −6
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ import org.junit.runners.Parameterized
 * - System Bars tests: checks the visibility of navigation and status bar
 * - Verify all tests with both gestural and 3-button navigation mode
 */
@RunWith(Parameterized::class)
abstract class BubbleFlickerTestBase : BubbleFlickerSubjects {

    @get:Rule
@@ -262,9 +261,5 @@ abstract class BubbleFlickerTestBase : BubbleFlickerSubjects {

// endregion

    companion object : FlickerPropertyInitializer() {
        @Parameterized.Parameters(name = "{0}")
        @JvmStatic
        fun data(): List<NavBar> = listOf(NavBar.MODE_GESTURAL, NavBar.MODE_3BUTTON)
    }
    companion object : FlickerPropertyInitializer()
}
 No newline at end of file
+7 −0
Original line number Diff line number Diff line
@@ -30,7 +30,9 @@ import com.android.wm.shell.flicker.bubbles.utils.FlickerPropertyInitializer
import com.android.wm.shell.flicker.bubbles.utils.RecordTraceWithTransitionRule
import org.junit.FixMethodOrder
import org.junit.Rule
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.junit.runners.Parameterized

/**
 * Test collapse bubble app via clicking back key.
@@ -55,6 +57,7 @@ import org.junit.runners.MethodSorters
@RequiresDevice
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Presubmit
@RunWith(Parameterized::class)
class CollapseBubbleAppViaBackTest(navBar: NavBar) : BubbleFlickerTestBase(),
    CollapseBubbleAppTestCases
{
@@ -64,6 +67,10 @@ class CollapseBubbleAppViaBackTest(navBar: NavBar) : BubbleFlickerTestBase(),
            transition = { collapseBubbleAppViaBackKey(testApp, tapl, wmHelper) },
            tearDownAfterTransition = { testApp.exit(wmHelper) }
        )

        @Parameterized.Parameters(name = "{0}")
        @JvmStatic
        fun data(): List<NavBar> = listOf(NavBar.MODE_GESTURAL, NavBar.MODE_3BUTTON)
    }

    @get:Rule
+7 −0
Original line number Diff line number Diff line
@@ -30,7 +30,9 @@ import com.android.wm.shell.flicker.bubbles.utils.FlickerPropertyInitializer
import com.android.wm.shell.flicker.bubbles.utils.RecordTraceWithTransitionRule
import org.junit.FixMethodOrder
import org.junit.Rule
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.junit.runners.Parameterized

/**
 * Test collapse bubble app via touching outside the bubble window.
@@ -55,6 +57,7 @@ import org.junit.runners.MethodSorters
@RequiresDevice
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Presubmit
@RunWith(Parameterized::class)
class CollapseBubbleAppViaTouchOutsideTest(navBar: NavBar) :
    BubbleFlickerTestBase(),
    CollapseBubbleAppTestCases
@@ -65,6 +68,10 @@ class CollapseBubbleAppViaTouchOutsideTest(navBar: NavBar) :
            transition = { collapseBubbleAppViaTouchOutside(testApp, wmHelper) },
            tearDownAfterTransition = { testApp.exit(wmHelper) }
        )

        @Parameterized.Parameters(name = "{0}")
        @JvmStatic
        fun data(): List<NavBar> = listOf(NavBar.MODE_GESTURAL, NavBar.MODE_3BUTTON)
    }

    @get:Rule
+7 −0
Original line number Diff line number Diff line
@@ -32,7 +32,9 @@ import org.junit.Assume.assumeTrue
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Rule
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.junit.runners.Parameterized

/**
 * Test dismiss bubble app via dragging bubble bar handle to the dismiss view when the bubble is in
@@ -58,6 +60,7 @@ import org.junit.runners.MethodSorters
@RequiresDevice
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Presubmit
@RunWith(Parameterized::class)
class DismissExpandedBubbleViaBubbleBarHandleTest(navBar: NavBar) : BubbleFlickerTestBase(),
    DismissExpandedBubbleTestCases {
    companion object : FlickerPropertyInitializer() {
@@ -66,6 +69,10 @@ class DismissExpandedBubbleViaBubbleBarHandleTest(navBar: NavBar) : BubbleFlicke
            transition = { dismissBubbleAppViaBubbleBarHandle(testApp, wmHelper) },
            tearDownAfterTransition = { testApp.exit() }
        )

        @Parameterized.Parameters(name = "{0}")
        @JvmStatic
        fun data(): List<NavBar> = listOf(NavBar.MODE_GESTURAL, NavBar.MODE_3BUTTON)
    }

    @get:Rule
Loading