diff options
3 files changed, 8 insertions, 6 deletions
diff --git a/services/tests/wmtests/src/com/android/server/wm/ScreenshotTests.java b/services/tests/wmtests/src/com/android/server/wm/ScreenshotTests.java index 280fe4c30739..34f7ebb0f7dd 100644 --- a/services/tests/wmtests/src/com/android/server/wm/ScreenshotTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/ScreenshotTests.java @@ -66,6 +66,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; +import java.time.Duration; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -131,7 +132,7 @@ public class ScreenshotTests { assertTrue("Failed to wait for transaction to get committed", countDownLatch.await(WAIT_TIME_S, TimeUnit.SECONDS)); assertTrue("Failed to wait for stable geometry", - waitForStableWindowGeometry(WAIT_TIME_S, TimeUnit.SECONDS)); + waitForStableWindowGeometry(Duration.ofSeconds(WAIT_TIME_S))); ScreenCapture.LayerCaptureArgs args = new ScreenCapture.LayerCaptureArgs.Builder(secureSC) .setCaptureSecureLayers(true) @@ -212,7 +213,7 @@ public class ScreenshotTests { assertTrue("Failed to wait for transaction to get committed", countDownLatch.await(WAIT_TIME_S, TimeUnit.SECONDS)); assertTrue("Failed to wait for stable geometry", - waitForStableWindowGeometry(WAIT_TIME_S, TimeUnit.SECONDS)); + waitForStableWindowGeometry(Duration.ofSeconds(WAIT_TIME_S))); ScreenshotHardwareBuffer[] screenCapture = new ScreenshotHardwareBuffer[1]; Bitmap screenshot = null; diff --git a/services/tests/wmtests/src/com/android/server/wm/TrustedOverlayTests.java b/services/tests/wmtests/src/com/android/server/wm/TrustedOverlayTests.java index f1d84cfc636d..529e9b77b4e0 100644 --- a/services/tests/wmtests/src/com/android/server/wm/TrustedOverlayTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/TrustedOverlayTests.java @@ -49,6 +49,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; +import java.time.Duration; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -144,7 +145,7 @@ public class TrustedOverlayTests { } } return false; - }, TIMEOUT_S, TimeUnit.SECONDS); + }, Duration.ofSeconds(TIMEOUT_S)); assertAndDumpWindowState(TAG, "Failed to find window or was not marked trusted", foundTrusted[0]); @@ -209,7 +210,7 @@ public class TrustedOverlayTests { } } return foundTrusted[0] && foundTrusted[1]; - }, TIMEOUT_S, TimeUnit.SECONDS); + }, Duration.ofSeconds(TIMEOUT_S)); if (!foundTrusted[0] || !foundTrusted[1]) { CtsWindowInfoUtils.dumpWindowsOnScreen(TAG, mName.getMethodName()); diff --git a/tests/Input/src/com/android/test/input/AnrTest.kt b/tests/Input/src/com/android/test/input/AnrTest.kt index 8d1fc508ffe7..d32cedb24a36 100644 --- a/tests/Input/src/com/android/test/input/AnrTest.kt +++ b/tests/Input/src/com/android/test/input/AnrTest.kt @@ -40,7 +40,7 @@ import androidx.test.uiautomator.Until import com.android.cts.input.DebugInputRule import com.android.cts.input.UinputTouchScreen -import java.util.concurrent.TimeUnit +import java.time.Duration import org.junit.After import org.junit.Assert.assertEquals @@ -193,6 +193,6 @@ class AnrTest { val flags = " -W -n " val startCmd = "am start $flags $PACKAGE_NAME/.UnresponsiveGestureMonitorActivity" instrumentation.uiAutomation.executeShellCommand(startCmd) - waitForStableWindowGeometry(5L, TimeUnit.SECONDS) + waitForStableWindowGeometry(Duration.ofSeconds(5)) } } |