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

Commit 0dc5880a authored by chaviw's avatar chaviw
Browse files

Synchronize RootWindowContainerTests

There were a few failures that seem to be threading issues.
Specifically, IndexOutOfBounds within a for loop that was iterating the
size of the ArrayList and ArrayMap index failure. RootWindowContainerTests
calls into methods in WM that assume the WM lock is already held. Ensure
testSetDisplayOverrideConfigurationIfNeeded is synchronized.

Test: RootWindowContainerTests#testSetDisplayOverrideConfigurationIfNeeded
Change-Id: I5003fc4a59baae4990a1464dbbc85b0938312994
Fixes: 78349285
parent 16771098
Loading
Loading
Loading
Loading
+24 −22
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue;
public class RootWindowContainerTests extends WindowTestsBase {
    @Test
    public void testSetDisplayOverrideConfigurationIfNeeded() throws Exception {
        synchronized (sWm.mWindowMap) {
            // Add first stack we expect to be updated with configuration change.
            final TaskStack stack = createTaskStackOnDisplay(mDisplayContent);
            stack.getOverrideConfiguration().windowConfiguration.setBounds(new Rect(0, 0, 5, 5));
@@ -48,3 +49,4 @@ public class RootWindowContainerTests extends WindowTestsBase {
            assertTrue(results[0] == stack.mStackId);
        }
    }
}