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

Commit 702f5a2c authored by Ats Jenk's avatar Ats Jenk Committed by Android (Google) Code Review
Browse files

Merge "Drag trampoline app from taskbar to bubble" into main

parents 553740a6 7fcb0db6
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ test_module_config {
        "com.android.wm.shell.flicker.bubbles.EnterBubbleFromHomeScreenTrampolineTest",
        "com.android.wm.shell.flicker.bubbles.EnterBubbleViaBubbleMenuTest",
        "com.android.wm.shell.flicker.bubbles.EnterBubbleViaDragToBubbleBarTest",
        "com.android.wm.shell.flicker.bubbles.EnterBubbleViaDragToBubbleBarTrampolineTest",
        "com.android.wm.shell.flicker.bubbles.EnterBubbleViaOverflowMenuTest",
        "com.android.wm.shell.flicker.bubbles.EnterBubbleWithImeViaBubbleMenuTest",
        "com.android.wm.shell.flicker.bubbles.ExpandBubbleViaBubbleStackTest",
@@ -179,6 +180,13 @@ test_module_config {
    include_filters: ["com.android.wm.shell.flicker.bubbles.EnterBubbleViaDragToBubbleBarTest"],
}

test_module_config {
    name: "WMShellExplicitFlickerTestsBubbles-EnterBubbleViaDragToBubbleBarTrampolineTest",
    base: "WMShellExplicitFlickerTestsBubbles",
    test_suites: ["device-tests"],
    include_filters: ["com.android.wm.shell.flicker.bubbles.EnterBubbleViaDragToBubbleBarTrampolineTest"],
}

test_module_config {
    name: "WMShellExplicitFlickerTestsBubbles-EnterBubbleViaOverflowMenuTest",
    base: "WMShellExplicitFlickerTestsBubbles",
+4 −0
Original line number Diff line number Diff line
@@ -60,6 +60,10 @@
      "name": "WMShellExplicitFlickerTestsBubbles-EnterBubbleViaDragToBubbleBarTest",
      "keywords": ["device"]
    },
    {
      "name": "WMShellExplicitFlickerTestsBubbles-EnterBubbleViaDragToBubbleBarTrampolineTest",
      "keywords": ["device"]
    },
    {
      "name": "WMShellExplicitFlickerTestsBubbles-EnterBubbleViaOverflowMenuTest",
      "keywords": ["device"]
+9 −3
Original line number Diff line number Diff line
@@ -26,17 +26,23 @@ import com.android.server.wm.flicker.testapp.ActivityOptions
 */
abstract class BubbleFlickerTrampolineTestBase : BubbleFlickerTestBase() {

    override val testApp = trampolineFinishApp
    override val testApp = runningApp

    companion object {
        val trampolineStartingApp: StandardAppHelper =
        /**
         * Entry point for the app that is launching via trampoline
         */
        val trampolineApp: StandardAppHelper =
            SimpleAppHelper(
                instrumentation,
                launcherName = ActivityOptions.TrampolineStartActivity.LABEL,
                component = ActivityOptions.TrampolineStartActivity.COMPONENT.toFlickerComponent(),
            )

        val trampolineFinishApp: StandardAppHelper =
        /**
         * App that will actually be running after the trampoline finishes
         */
        val runningApp: StandardAppHelper =
            SimpleAppHelper(
                instrumentation,
                launcherName = ActivityOptions.TrampolineFinishActivity.LABEL,
+7 −11
Original line number Diff line number Diff line
@@ -36,7 +36,9 @@ import org.junit.runners.MethodSorters
 * clicking bubble menu from the home screen.
 *
 * To run this test:
 *     `atest WMShellExplicitFlickerTestsBubbles:EnterBubbleFromHomeScreenTrampolineTest`
 * ```
 *     atest WMShellExplicitFlickerTestsBubbles:EnterBubbleFromHomeScreenTrampolineTest
 * ```
 *
 * Actions:
 * ```
@@ -45,7 +47,7 @@ import org.junit.runners.MethodSorters
 * ```
 *
 * Verified tests:
 * - [BubbleFlickerTestBase]
 * - [BubbleFlickerTrampolineTestBase]
 * - [EnterBubbleTestCases]
 */
@RequiresFlagsEnabled(Flags.FLAG_ENABLE_CREATE_ANY_BUBBLE)
@@ -59,19 +61,13 @@ open class EnterBubbleFromHomeScreenTrampolineTest :
        private val recordTraceWithTransitionRule =
            RecordTraceWithTransitionRule(
                transition = {
                    launchBubbleViaBubbleMenu(
                        trampolineStartingApp,
                        tapl,
                        wmHelper,
                        FROM_HOME_SCREEN,
                    )
                    launchBubbleViaBubbleMenu(trampolineApp, tapl, wmHelper, FROM_HOME_SCREEN)
                },
                tearDownAfterTransition = {
                    trampolineFinishApp.exit(wmHelper)
                    runningApp.exit(wmHelper)
                    // Clean up the app icon that might have been added to the home screen during
                    // the test transition.
                    val testAppIcon =
                        tapl.workspace.getWorkspaceAppIcon(trampolineStartingApp.appName)
                    val testAppIcon = tapl.workspace.getWorkspaceAppIcon(trampolineApp.appName)
                    tapl.workspace.deleteAppIcon(testAppIcon)
                },
            )
+3 −19
Original line number Diff line number Diff line
@@ -19,12 +19,10 @@ package com.android.wm.shell.flicker.bubbles
import android.platform.test.annotations.Presubmit
import android.platform.test.annotations.RequiresFlagsEnabled
import android.tools.NavBar
import android.tools.traces.component.ComponentNameMatcher.Companion.LAUNCHER
import android.tools.traces.component.ComponentNameMatcher.Companion.TASK_BAR
import androidx.test.filters.RequiresDevice
import com.android.wm.shell.Flags
import com.android.wm.shell.Utils
import com.android.wm.shell.flicker.bubbles.testcase.EnterBubbleTestCases
import com.android.wm.shell.flicker.bubbles.testcase.EnterBubbleViaDragToBubbleBarTestCases
import com.android.wm.shell.flicker.bubbles.utils.ApplyPerParameterRule
import com.android.wm.shell.flicker.bubbles.utils.BubbleFlickerTestHelper.launchBubbleViaDragToBubbleBar
import com.android.wm.shell.flicker.bubbles.utils.RecordTraceWithTransitionRule
@@ -33,7 +31,6 @@ import org.junit.Assume.assumeTrue
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TestRule
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
@@ -55,7 +52,7 @@ import org.junit.runners.Parameterized
 * ```
 * Verified tests:
 * - [BubbleFlickerTestBase]
 * - [EnterBubbleTestCases]
 * - [EnterBubbleViaDragToBubbleBarTestCases]
 */
@RequiresFlagsEnabled(Flags.FLAG_ENABLE_CREATE_ANY_BUBBLE, Flags.FLAG_ENABLE_BUBBLE_BAR)
@RequiresDevice
@@ -63,7 +60,7 @@ import org.junit.runners.Parameterized
@Presubmit
@RunWith(Parameterized::class)
class EnterBubbleViaDragToBubbleBarTest(navBar: NavBar) : BubbleFlickerTestBase(),
    EnterBubbleTestCases {
    EnterBubbleViaDragToBubbleBarTestCases {

    companion object {
        private val recordTraceWithTransitionRule = RecordTraceWithTransitionRule(
@@ -94,17 +91,4 @@ class EnterBubbleViaDragToBubbleBarTest(navBar: NavBar) : BubbleFlickerTestBase(
        assumeTrue(tapl.isTablet)
        super.setUp()
    }

    @Test
    override fun focusChanges() {
        eventLogSubject.focusChanges(
            LAUNCHER.toWindowName(),
            // Tap on the task bar.
            TASK_BAR.toWindowName(),
            // Drag an icon from task bar to the bubble bar location.
            LAUNCHER.toWindowName(),
            // The bubble app launches.
            testApp.toWindowName()
        )
    }
}
 No newline at end of file
Loading