From 5e79a4208fb8f2e6330affd84abeee771730e8d9 Mon Sep 17 00:00:00 2001 From: Chavi Weingarten Date: Tue, 2 May 2023 23:04:17 +0000 Subject: [PATCH] Fix SurfaceSyncGroupTests SurfaceSyncGroupTest was using a stub transaction for SurfaceSyncGroup, but was not resetting it to the real Transaction when the test was complete. This made the following test that was expecting to use real Transactions fail. Fixes: 279141968 Test: SurfaceSyncGroupTest SurfaceSyncGroupTests Change-Id: Ifa1122ff9d74c8850b8c46216846a4e1b73f4c1c --- .../src/com/android/server/wm/SurfaceSyncGroupTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/tests/wmtests/src/com/android/server/wm/SurfaceSyncGroupTest.java b/services/tests/wmtests/src/com/android/server/wm/SurfaceSyncGroupTest.java index c8fc6b892bc88..d84620b4444ad 100644 --- a/services/tests/wmtests/src/com/android/server/wm/SurfaceSyncGroupTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/SurfaceSyncGroupTest.java @@ -32,6 +32,7 @@ import androidx.test.filters.SmallTest; import com.android.server.testutils.StubTransaction; +import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -52,6 +53,11 @@ public class SurfaceSyncGroupTest { SurfaceSyncGroup.setTransactionFactory(StubTransaction::new); } + @After + public void tearDown() { + SurfaceSyncGroup.setTransactionFactory(SurfaceControl.Transaction::new); + } + @Test public void testSyncOne() throws InterruptedException { final CountDownLatch finishedLatch = new CountDownLatch(1);