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

Commit a32ef5bd authored by Nataniel Borges's avatar Nataniel Borges Committed by Android (Google) Code Review
Browse files

Merge "Updates flicker documentation and improve naming" into sc-dev

parents 072bedce 6fa330e7
Loading
Loading
Loading
Loading
+12 −14
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ package com.android.wm.shell.flicker

import android.graphics.Region
import android.view.Surface
import com.android.server.wm.flicker.APP_PAIR_SPLIT_DIVIDER
import com.android.server.wm.flicker.DOCKED_STACK_DIVIDER
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.helpers.WindowUtils
import com.android.server.wm.flicker.traces.layers.getVisibleBounds
@@ -32,15 +30,15 @@ fun FlickerTestParameter.appPairsDividerIsVisible() {

fun FlickerTestParameter.appPairsDividerIsInvisible() {
    assertLayersEnd {
        this.notExists(APP_PAIR_SPLIT_DIVIDER)
        this.notContains(APP_PAIR_SPLIT_DIVIDER)
    }
}

fun FlickerTestParameter.appPairsDividerBecomesVisible() {
    assertLayers {
        this.hidesLayer(DOCKED_STACK_DIVIDER)
        this.isInvisible(DOCKED_STACK_DIVIDER)
            .then()
            .showsLayer(DOCKED_STACK_DIVIDER)
            .isVisible(DOCKED_STACK_DIVIDER)
    }
}

@@ -52,30 +50,30 @@ fun FlickerTestParameter.dockedStackDividerIsVisible() {

fun FlickerTestParameter.dockedStackDividerBecomesVisible() {
    assertLayers {
        this.hidesLayer(DOCKED_STACK_DIVIDER)
        this.isInvisible(DOCKED_STACK_DIVIDER)
            .then()
            .showsLayer(DOCKED_STACK_DIVIDER)
            .isVisible(DOCKED_STACK_DIVIDER)
    }
}

fun FlickerTestParameter.dockedStackDividerBecomesInvisible() {
    assertLayers {
        this.showsLayer(DOCKED_STACK_DIVIDER)
        this.isVisible(DOCKED_STACK_DIVIDER)
            .then()
            .hidesLayer(DOCKED_STACK_DIVIDER)
            .isInvisible(DOCKED_STACK_DIVIDER)
    }
}

fun FlickerTestParameter.dockedStackDividerIsInvisible() {
    assertLayersEnd {
        this.notExists(DOCKED_STACK_DIVIDER)
        this.notContains(DOCKED_STACK_DIVIDER)
    }
}

fun FlickerTestParameter.appPairsPrimaryBoundsIsVisible(rotation: Int, primaryLayerName: String) {
    assertLayersEnd {
        val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
        this.hasVisibleRegion(primaryLayerName, getPrimaryRegion(dividerRegion, rotation))
        this.coversExactly(getPrimaryRegion(dividerRegion, rotation), primaryLayerName)
    }
}

@@ -85,7 +83,7 @@ fun FlickerTestParameter.dockedStackPrimaryBoundsIsVisible(
) {
    assertLayersEnd {
        val dividerRegion = entry.getVisibleBounds(DOCKED_STACK_DIVIDER)
        this.hasVisibleRegion(primaryLayerName, getPrimaryRegion(dividerRegion, rotation))
        this.coversExactly(getPrimaryRegion(dividerRegion, rotation), primaryLayerName)
    }
}

@@ -95,7 +93,7 @@ fun FlickerTestParameter.appPairsSecondaryBoundsIsVisible(
) {
    assertLayersEnd {
        val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
        this.hasVisibleRegion(secondaryLayerName, getSecondaryRegion(dividerRegion, rotation))
        this.coversExactly(getSecondaryRegion(dividerRegion, rotation), secondaryLayerName)
    }
}

@@ -105,7 +103,7 @@ fun FlickerTestParameter.dockedStackSecondaryBoundsIsVisible(
) {
    assertLayersEnd {
        val dividerRegion = entry.getVisibleBounds(DOCKED_STACK_DIVIDER)
        this.hasVisibleRegion(secondaryLayerName, getSecondaryRegion(dividerRegion, rotation))
        this.coversExactly(getSecondaryRegion(dividerRegion, rotation), secondaryLayerName)
    }
}

+2 −0
Original line number Diff line number Diff line
@@ -18,3 +18,5 @@ package com.android.wm.shell.flicker

const val IME_WINDOW_NAME = "InputMethod"
const val SYSTEM_UI_PACKAGE_NAME = "com.android.systemui"
const val APP_PAIR_SPLIT_DIVIDER = "AppPairSplitDivider"
const val DOCKED_STACK_DIVIDER = "DockedStackDivider"
 No newline at end of file
+1 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.wm.shell.flicker.apppairs

import android.os.Bundle
import android.os.SystemClock
import android.platform.test.annotations.Presubmit
import androidx.test.filters.RequiresDevice
@@ -48,7 +47,7 @@ class AppPairsTestCannotPairNonResizeableApps(
    testSpec: FlickerTestParameter
) : AppPairsTransition(testSpec) {

    override val transition: FlickerBuilder.(Bundle) -> Unit
    override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
        get() = {
            super.transition(this, it)
            transitions {
+6 −7
Original line number Diff line number Diff line
@@ -16,17 +16,16 @@

package com.android.wm.shell.flicker.apppairs

import android.os.Bundle
import android.os.SystemClock
import android.platform.test.annotations.Presubmit
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.APP_PAIR_SPLIT_DIVIDER
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
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.traces.layers.getVisibleBounds
import com.android.wm.shell.flicker.APP_PAIR_SPLIT_DIVIDER
import com.android.wm.shell.flicker.appPairsDividerIsVisible
import com.android.wm.shell.flicker.helpers.AppPairsHelper
import org.junit.FixMethodOrder
@@ -46,7 +45,7 @@ import org.junit.runners.Parameterized
class AppPairsTestPairPrimaryAndSecondaryApps(
    testSpec: FlickerTestParameter
) : AppPairsTransition(testSpec) {
    override val transition: FlickerBuilder.(Bundle) -> Unit
    override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
        get() = {
            super.transition(this, it)
            transitions {
@@ -75,10 +74,10 @@ class AppPairsTestPairPrimaryAndSecondaryApps(
    fun appsEndingBounds() {
        testSpec.assertLayersEnd {
            val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
            this.hasVisibleRegion(primaryApp.defaultWindowName,
                appPairsHelper.getPrimaryBounds(dividerRegion))
                .hasVisibleRegion(secondaryApp.defaultWindowName,
                    appPairsHelper.getSecondaryBounds(dividerRegion))
            this.coversExactly(appPairsHelper.getPrimaryBounds(dividerRegion),
                primaryApp.defaultWindowName)
                .coversExactly(appPairsHelper.getSecondaryBounds(dividerRegion),
                    secondaryApp.defaultWindowName)
        }
    }

+8 −9
Original line number Diff line number Diff line
@@ -16,17 +16,16 @@

package com.android.wm.shell.flicker.apppairs

import android.os.Bundle
import android.os.SystemClock
import android.platform.test.annotations.Presubmit
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.APP_PAIR_SPLIT_DIVIDER
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
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.traces.layers.getVisibleBounds
import com.android.wm.shell.flicker.APP_PAIR_SPLIT_DIVIDER
import com.android.wm.shell.flicker.appPairsDividerIsInvisible
import com.android.wm.shell.flicker.helpers.AppPairsHelper
import org.junit.FixMethodOrder
@@ -46,7 +45,7 @@ import org.junit.runners.Parameterized
class AppPairsTestUnpairPrimaryAndSecondaryApps(
    testSpec: FlickerTestParameter
) : AppPairsTransition(testSpec) {
    override val transition: FlickerBuilder.(Bundle) -> Unit
    override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
        get() = {
            super.transition(this, it)
            setup {
@@ -80,10 +79,10 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps(
    fun appsStartingBounds() {
        testSpec.assertLayersStart {
            val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
            hasVisibleRegion(primaryApp.defaultWindowName,
                appPairsHelper.getPrimaryBounds(dividerRegion))
            hasVisibleRegion(secondaryApp.defaultWindowName,
                appPairsHelper.getSecondaryBounds(dividerRegion))
            coversExactly(appPairsHelper.getPrimaryBounds(dividerRegion),
                primaryApp.defaultWindowName)
            coversExactly(appPairsHelper.getSecondaryBounds(dividerRegion),
                secondaryApp.defaultWindowName)
        }
    }

@@ -91,8 +90,8 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps(
    @Test
    fun appsEndingBounds() {
        testSpec.assertLayersEnd {
            notExists(primaryApp.defaultWindowName)
            notExists(secondaryApp.defaultWindowName)
            notContains(primaryApp.defaultWindowName)
            notContains(secondaryApp.defaultWindowName)
        }
    }

Loading