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

Commit a9295a66 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Fix PhoneStatusBarViewControllerTest

A previous cl made the propagation of the event to the shade display policy go though onInterceptTouchEvent instead than onTouch.

Unexpectedly, presubmits didn't catch this

Bug: 404543435
Test: PhoneStatusBarViewControllerTest
Flag: com.android.systemui.shade_window_goes_around
Change-Id: I67ab327a38513033f57accbe49726db2dda832bd
parent 101e73a1
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -445,27 +445,30 @@ class PhoneStatusBarViewControllerTest : SysuiTestCase() {

    @Test
    @EnableFlags(ShadeWindowGoesAround.FLAG_NAME)
    fun onTouch_actionDown_propagatesToDisplayPolicy() {
    fun onInterceptTouchEvent_actionDown_propagatesToDisplayPolicy() {
        val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0)
        controller.onTouch(event)

        view.onInterceptTouchEvent(event)

        verify(statusBarTouchShadeDisplayPolicy).onStatusBarTouched(eq(event), any())
    }

    @Test
    @EnableFlags(ShadeWindowGoesAround.FLAG_NAME)
    fun onTouch_actionUp_notPropagatesToDisplayPolicy() {
    fun onInterceptTouchEvent_actionUp_notPropagatesToDisplayPolicy() {
        val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_UP, 0f, 0f, 0)
        controller.onTouch(event)

        view.onInterceptTouchEvent(event)

        verify(statusBarTouchShadeDisplayPolicy, never()).onStatusBarTouched(any(), any())
    }

    @Test
    @DisableFlags(ShadeWindowGoesAround.FLAG_NAME)
    fun onTouch_shadeWindowGoesAroundDisabled_notPropagatesToDisplayPolicy() {
    fun onInterceptTouchEvent_shadeWindowGoesAroundDisabled_notPropagatesToDisplayPolicy() {
        val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0)
        controller.onTouch(event)

        view.onInterceptTouchEvent(event)

        verify(statusBarTouchShadeDisplayPolicy, never()).onStatusBarTouched(eq(event), any())
    }