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

Commit 816c9464 authored by Nataniel Borges's avatar Nataniel Borges
Browse files

3/ Update flicker tests to compatibilize with new apps

Test: atest FlickerLibTest && atest FlickerTests
Change-Id: I9306a2a3905026a5eee53c8ae6f0aa0f87bc42c9
parent 2c0caa00
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -48,6 +48,6 @@ android_test {
        "wm-flicker-common-assertions",
        "wm-flicker-common-app-helpers",
        "platform-test-annotations",
        "wmshell-flicker-test-components",
        "flickertestapplib",
    ],
}
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
        <option name="cleanup-apks" value="true"/>
        <option name="test-file-name" value="WMShellFlickerTests.apk"/>
        <option name="test-file-name" value="WMShellFlickerTestApp.apk" />
        <option name="test-file-name" value="FlickerTestApp.apk" />
    </target_preparer>
    <test class="com.android.tradefed.testtype.AndroidJUnitTest">
        <option name="package" value="com.android.wm.shell.flicker"/>
+3 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.wm.shell.flicker.bubble
import android.app.INotificationManager
import android.app.NotificationManager
import android.content.Context
import android.content.pm.PackageManager
import android.os.ServiceManager
import android.view.Surface
import androidx.test.uiautomator.By
@@ -28,9 +29,9 @@ import com.android.server.wm.flicker.Flicker
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.FlickerTestParameterFactory
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.LaunchBubbleHelper
import com.android.server.wm.flicker.helpers.SYSTEMUI_PACKAGE
import com.android.wm.shell.flicker.BaseTest
import com.android.wm.shell.flicker.helpers.LaunchBubbleHelper
import org.junit.runners.Parameterized

/**
@@ -47,7 +48,7 @@ abstract class BaseBubbleScreen(
            ServiceManager.getService(Context.NOTIFICATION_SERVICE))

    private val uid = context.packageManager.getApplicationInfo(
            testApp.`package`, 0).uid
            testApp.`package`, PackageManager.ApplicationInfoFlags.of(0)).uid

    @JvmOverloads
    protected open fun buildTransition(
+0 −20
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@file:JvmName("CommonAssertions")
package com.android.wm.shell.flicker.pip

internal const val PIP_WINDOW_COMPONENT = "PipMenuActivity"
+6 −5
Original line number Diff line number Diff line
@@ -28,16 +28,17 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
import com.android.server.wm.flicker.annotation.Group3
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.entireScreenCovered
import com.android.server.wm.flicker.helpers.FixedOrientationAppHelper
import com.android.server.wm.flicker.helpers.WindowUtils
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
import com.android.server.wm.flicker.navBarLayerPositionAtStartAndEnd
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule
import com.android.wm.shell.flicker.helpers.FixedAppHelper
import com.android.server.wm.flicker.testapp.ActivityOptions.Pip.ACTION_ENTER_PIP
import com.android.server.wm.flicker.testapp.ActivityOptions.PortraitOnlyActivity.EXTRA_FIXED_ORIENTATION
import com.android.server.wm.traces.common.ComponentNameMatcher
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_LANDSCAPE
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_PORTRAIT
import com.android.wm.shell.flicker.testapp.Components.FixedActivity.EXTRA_FIXED_ORIENTATION
import com.android.wm.shell.flicker.testapp.Components.PipActivity.ACTION_ENTER_PIP
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
@@ -72,7 +73,7 @@ import org.junit.runners.Parameterized
class EnterPipToOtherOrientationTest(
    testSpec: FlickerTestParameter
) : PipTransition(testSpec) {
    private val testApp = FixedAppHelper(instrumentation)
    private val testApp = FixedOrientationAppHelper(instrumentation)
    private val startingBounds = WindowUtils.getDisplayBounds(Surface.ROTATION_90)
    private val endingBounds = WindowUtils.getDisplayBounds(Surface.ROTATION_0)

@@ -127,7 +128,7 @@ class EnterPipToOtherOrientationTest(
    }

    /**
     * Checks that the [ComponentMatcher.NAV_BAR] has the correct position at
     * Checks that the [ComponentNameMatcher.NAV_BAR] has the correct position at
     * the start and end of the transition
     */
    @FlakyTest
Loading