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

Commit cf15e4d9 authored by Charles Chen's avatar Charles Chen Committed by Android (Google) Code Review
Browse files

Merge "Fix wrong assertions" into main

parents 6c868f83 e2069c60
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
      "name": "WMShellExplicitFlickerTestsBubbles-CollapseBubbleViaBackTest"
    },
    {
      "name": "WMShellExplicitFlickerTestsBubbles-DismissExpandedBubbleViaBubbleViewTes"
      "name": "WMShellExplicitFlickerTestsBubbles-DismissExpandedBubbleViaBubbleViewTest"
    },
    {
      "name": "WMShellExplicitFlickerTestsBubbles-EnterBubbleViaBubbleMenuTest"
+1 −1
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ abstract class BubbleFlickerTestBase : BubbleFlickerSubjects {
     * consecutive entries
     */
    @Test
    fun visibleLayersShownMoreThanOneConsecutiveEntry() {
    open fun visibleLayersShownMoreThanOneConsecutiveEntry() {
        layersTraceSubject
            .visibleLayersShownMoreThanOneConsecutiveEntry()
            .forAllEntries()
+8 −17
Original line number Diff line number Diff line
@@ -64,23 +64,6 @@ class CollapseBubbleViaBackTest :
    BubbleStackAlwaysVisibleTestCases,
    BubbleAppBecomesNotExpandedTestCases
{

    /**
     * Verifies bubble app window becomes invisible at the end of the transition.
     */
    @Test
    fun appWindowIsInvisibleAtEnd() {
        wmStateSubjectAtEnd.isAppWindowInvisible(testApp)
    }

    /**
     * Verifies bubble app layer becomes invisible at the end of the transition.
     */
    @Test
    fun appLayerIsInvisibleAtEnd() {
        layerTraceEntrySubjectAtEnd.isInvisible(testApp, mustExist = true)
    }

    companion object : FlickerPropertyInitializer() {

        @ClassRule
@@ -97,4 +80,12 @@ class CollapseBubbleViaBackTest :

    override val traceDataReader
        get() = recordTraceWithTransitionRule.reader

    /**
     * Verifies bubble app window is invisible at the end of the transition.
     */
    @Test
    override fun appWindowIsInvisibleAtEnd() {
        wmStateSubjectAtEnd.isAppWindowInvisible(testApp, mustExist = true)
    }
}
 No newline at end of file
+14 −21
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.platform.test.annotations.RequiresDevice
import android.platform.test.annotations.RequiresFlagsEnabled
import android.tools.traces.component.ComponentNameMatcher.Companion.BUBBLE
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.FlakyTest
import com.android.wm.shell.Flags
import com.android.wm.shell.flicker.bubbles.testcase.BubbleAppBecomesNotExpandedTestCases
import com.android.wm.shell.flicker.bubbles.utils.FlickerPropertyInitializer
@@ -113,9 +114,9 @@ class DismissExpandedBubbleViaBubbleViewTest :
        wmTraceSubject
            .isAboveAppWindowVisible(BUBBLE)
            .then()
            // bubble stack may be invisible before it's gone.
            .isAboveAppWindowInvisible(BUBBLE, isOptional = true)
            .notContains(BUBBLE)
            // Use #isNonAppWindowInvisible here because the BUBBLE window may have been removed
            // from WM hierarchy.
            .isNonAppWindowInvisible(BUBBLE)
            .forAllEntries()
    }

@@ -127,10 +128,7 @@ class DismissExpandedBubbleViaBubbleViewTest :
        layersTraceSubject
            .isVisible(BUBBLE)
            .then()
            // bubble stack may be invisible before it's gone.
            .isInvisible(BUBBLE, mustExist = true, isOptional = true)
            .then()
            .notContains(BUBBLE)
            .isInvisible(BUBBLE)
            .forAllEntries()
    }

@@ -138,14 +136,6 @@ class DismissExpandedBubbleViaBubbleViewTest :

// region bubble app related tests

    /**
     * Verifies the [testApp] window has rounded corner at the start of the transition.
     */
    @Test
    fun appWindowHasRoundedCornerAtStart() {
        layerTraceEntrySubjectAtStart.hasRoundedCorners(testApp)
    }

    /**
     * Verifies bubble app window is gone at the end of the transition.
     */
@@ -154,13 +144,16 @@ class DismissExpandedBubbleViaBubbleViewTest :
        wmStateSubjectAtEnd.notContains(testApp)
    }

    /**
     * Verifies bubble app layer is gone at the end of the transition.
     */
    @FlakyTest(bugId = 396020056)
    @Test
    override fun appLayerBecomesInvisible() {
        super.appLayerBecomesInvisible()
    }

    @FlakyTest(bugId = 396020056)
    @Test
    fun appLayerIsGoneAtEnd() {
        // TestApp may be gone if it's in dismissed state.
        layerTraceEntrySubjectAtEnd.notContains(testApp)
    override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
        super.visibleLayersShownMoreThanOneConsecutiveEntry()
    }

// endregion
+26 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.wm.shell.flicker.bubbles.testcase

import android.tools.traces.component.ComponentNameMatcher.Companion.LAUNCHER
import com.android.wm.shell.flicker.bubbles.DismissExpandedBubbleViaBubbleViewTest.Companion.testApp
import com.android.wm.shell.flicker.bubbles.utils.BubbleFlickerSubjects
import org.junit.Test

@@ -50,6 +51,31 @@ interface BubbleAppBecomesNotExpandedTestCases : BubbleFlickerSubjects {
            .forAllEntries()
    }

    /**
     * Verifies the [testApp] window has rounded corner at the start of the transition.
     */
    @Test
    fun appWindowHasRoundedCornerAtStart() {
        layerTraceEntrySubjectAtStart.hasRoundedCorners(testApp)
    }

    /**
     * Verifies bubble app window is invisible at the end of the transition.
     */
    @Test
    fun appWindowIsInvisibleAtEnd() {
        wmStateSubjectAtEnd.isAppWindowInvisible(testApp)
    }

    /**
     * Verifies bubble app layer is invisible at the end of the transition.
     */
    @Test
    fun appLayerIsInvisibleAtEnd() {
        // TestApp may be gone if it's in dismissed state.
        layerTraceEntrySubjectAtEnd.isInvisible(testApp)
    }

    /**
     * Verifies the focus changed from launcher to bubble app.
     */