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

Commit 7a1710e7 authored by Hiroki Sato's avatar Hiroki Sato
Browse files

Add AccessibilityWindowManagerWithAccessibilityWindowTest

This is a copy of AccessibilityWindowManagerTest.

With the new data flow behind a flag compute_window_changes_on_a11y,
the tests have to change their set up (updating windows from wm).
This means all test cases in AccessibilityWindowManagerTest has to be
updated.

In the following CL, the tests will be updated to use a new flow.
This CL just copies the old tests with a new name so that future CLs get
a clear diff.

Bug: 322444245
Bug: 325341171
Test: AccessibilityWindowManagerTest AccessibilityWindowManagerWithAccessibilityWindowTest
Change-Id: I51bc70c4b4a478ae59d993546e79518095106ecc
parent a7bbb2f8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ android_test {
        "ravenwood-junit",
        "net_flags_lib",
        "CtsVirtualDeviceCommonLib",
        "com_android_server_accessibility_flags_lib",
    ],

    libs: [
+16 −1
Original line number Diff line number Diff line
@@ -47,6 +47,9 @@ import android.os.IBinder;
import android.os.LocaleList;
import android.os.RemoteException;
import android.os.UserHandle;
import android.platform.test.annotations.RequiresFlagsDisabled;
import android.platform.test.flag.junit.CheckFlagsRule;
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.util.SparseArray;
import android.view.Display;
import android.view.IWindow;
@@ -67,6 +70,7 @@ import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
@@ -77,9 +81,16 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

// This test verifies deprecated codepath. Probably changing this file means
// AccessibilityWindowManagerWithAccessibilityWindowTest also needs to be updated.
// LINT.IfChange

/**
 * Tests for the AccessibilityWindowManager
 * Tests for the AccessibilityWindowManager with Flags.FLAG_COMPUTE_WINDOW_CHANGES_ON_A11Y enabled.
 * TODO(b/322444245): Merge with AccessibilityWindowManagerWithAccessibilityWindowTest
 *  after completing the flag migration.
 */
@RequiresFlagsDisabled(Flags.FLAG_COMPUTE_WINDOW_CHANGES_ON_A11Y)
public class AccessibilityWindowManagerTest {
    private static final String PACKAGE_NAME = "com.android.server.accessibility";
    private static final boolean FORCE_SEND = true;
@@ -132,6 +143,9 @@ public class AccessibilityWindowManagerTest {
    @Mock private IBinder mMockEmbeddedToken;
    @Mock private IBinder mMockInvalidToken;

    @Rule
    public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();

    @Before
    public void setUp() throws RemoteException {
        MockitoAnnotations.initMocks(this);
@@ -1227,3 +1241,4 @@ public class AccessibilityWindowManagerTest {
        }
    }
}
// LINT.ThenChange(/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityWindowManagerWithAccessibilityWindowTest.java)
+1247 −0

File added.

Preview size limit exceeded, changes collapsed.