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

Commit aa88974a authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Wait for stable window geometry in UinputRecordingIntegrationTests

From the log analysis, touch sometimes was getting dropped due to
occlusion by "window={transition snapshot: Display{#2...".

A speculative fix proposed in this CL is to wait for stable window
geometry after the activity is launched.

Bug: 385141667
Flag: TEST_ONLY
Test: atest UinputRecordingIntegrationTests
Change-Id: I1f1c65bd6a29b24880bfc51e150e9d0d2c9e2076
parent 48a1873f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.util.Size
import android.view.InputEvent
import android.view.MotionEvent
import androidx.test.platform.app.InstrumentationRegistry
import android.server.wm.CtsWindowInfoUtils.waitForStableWindowGeometry
import com.android.cts.input.BatchedEventSplitter
import com.android.cts.input.InputJsonParser
import com.android.cts.input.VirtualDisplayActivityScenario
@@ -36,6 +37,7 @@ import com.android.cts.input.inputeventmatchers.withMotionAction
import com.android.cts.input.inputeventmatchers.withPressure
import com.android.cts.input.inputeventmatchers.withRawCoords
import com.android.cts.input.inputeventmatchers.withSource
import java.time.Duration
import junit.framework.Assert.fail
import org.hamcrest.Matchers.allOf
import org.junit.Before
@@ -113,6 +115,7 @@ class UinputRecordingIntegrationTests {
            testName,
            size = testData.displaySize
        ).use { scenario ->
            waitForStableWindowGeometry(Duration.ofSeconds(5))
            scenario.activity.window.decorView.requestUnbufferedDispatch(INPUT_DEVICE_SOURCE_ALL)

            try {