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

Commit 1d8d37bb authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Android (Google) Code Review
Browse files

Merge "Add HW_TIMEOUT_MULTIPLIER to timeouts" into udc-dev

parents 74240559 c53786b5
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.wm;

import static android.os.Build.HW_TIMEOUT_MULTIPLIER;
import static android.window.SurfaceSyncGroup.TRANSACTION_READY_TIMEOUT;

import static org.junit.Assert.assertEquals;
@@ -52,6 +53,8 @@ import java.util.concurrent.TimeUnit;
public class SurfaceSyncGroupTests {
    private static final String TAG = "SurfaceSyncGroupTests";

    private static final long TIMEOUT_S = HW_TIMEOUT_MULTIPLIER * 5L;

    @Rule
    public ActivityTestRule<SurfaceSyncGroupActivity> mActivityRule = new ActivityTestRule<>(
            SurfaceSyncGroupActivity.class);
@@ -93,7 +96,7 @@ public class SurfaceSyncGroupTests {
        addSecondSyncGroup(secondSsg, secondDrawCompleteLatch, bothSyncGroupsComplete);

        assertTrue("Failed to draw two frames",
                secondDrawCompleteLatch.await(5, TimeUnit.SECONDS));
                secondDrawCompleteLatch.await(TIMEOUT_S, TimeUnit.SECONDS));

        mHandler.postDelayed(() -> {
            // Don't add a markSyncReady for the first sync group until after it's added to another
@@ -105,7 +108,7 @@ public class SurfaceSyncGroupTests {
        }, 200);

        assertTrue("Failed to wait for both SurfaceSyncGroups to apply",
                bothSyncGroupsComplete.await(5, TimeUnit.SECONDS));
                bothSyncGroupsComplete.await(TIMEOUT_S, TimeUnit.SECONDS));

        validateScreenshot();
    }
@@ -123,7 +126,7 @@ public class SurfaceSyncGroupTests {
                transaction -> mHandler.postDelayed(() -> {
                    try {
                        assertTrue("Failed to draw two frames",
                                secondDrawCompleteLatch.await(5, TimeUnit.SECONDS));
                                secondDrawCompleteLatch.await(TIMEOUT_S, TimeUnit.SECONDS));
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
@@ -143,7 +146,7 @@ public class SurfaceSyncGroupTests {
        addSecondSyncGroup(secondSsg, secondDrawCompleteLatch, bothSyncGroupsComplete);

        assertTrue("Failed to wait for both SurfaceSyncGroups to apply",
                bothSyncGroupsComplete.await(5, TimeUnit.SECONDS));
                bothSyncGroupsComplete.await(TIMEOUT_S, TimeUnit.SECONDS));

        validateScreenshot();
    }