Merge "Synchronize RootWindowContainerTests" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
628e9b3d37
@@ -24,27 +24,29 @@ import static org.junit.Assert.assertTrue;
|
|||||||
public class RootWindowContainerTests extends WindowTestsBase {
|
public class RootWindowContainerTests extends WindowTestsBase {
|
||||||
@Test
|
@Test
|
||||||
public void testSetDisplayOverrideConfigurationIfNeeded() throws Exception {
|
public void testSetDisplayOverrideConfigurationIfNeeded() throws Exception {
|
||||||
// Add first stack we expect to be updated with configuration change.
|
synchronized (sWm.mWindowMap) {
|
||||||
final TaskStack stack = createTaskStackOnDisplay(mDisplayContent);
|
// Add first stack we expect to be updated with configuration change.
|
||||||
stack.getOverrideConfiguration().windowConfiguration.setBounds(new Rect(0, 0, 5, 5));
|
final TaskStack stack = createTaskStackOnDisplay(mDisplayContent);
|
||||||
|
stack.getOverrideConfiguration().windowConfiguration.setBounds(new Rect(0, 0, 5, 5));
|
||||||
|
|
||||||
// Add second task that will be set for deferred removal that should not be returned
|
// Add second task that will be set for deferred removal that should not be returned
|
||||||
// with the configuration change.
|
// with the configuration change.
|
||||||
final TaskStack deferredDeletedStack = createTaskStackOnDisplay(mDisplayContent);
|
final TaskStack deferredDeletedStack = createTaskStackOnDisplay(mDisplayContent);
|
||||||
deferredDeletedStack.getOverrideConfiguration().windowConfiguration.setBounds(
|
deferredDeletedStack.getOverrideConfiguration().windowConfiguration.setBounds(
|
||||||
new Rect(0, 0, 5, 5));
|
new Rect(0, 0, 5, 5));
|
||||||
deferredDeletedStack.mDeferRemoval = true;
|
deferredDeletedStack.mDeferRemoval = true;
|
||||||
|
|
||||||
final Configuration override = new Configuration(
|
final Configuration override = new Configuration(
|
||||||
mDisplayContent.getOverrideConfiguration());
|
mDisplayContent.getOverrideConfiguration());
|
||||||
override.windowConfiguration.setBounds(new Rect(0, 0, 10, 10));
|
override.windowConfiguration.setBounds(new Rect(0, 0, 10, 10));
|
||||||
|
|
||||||
// Set display override.
|
// Set display override.
|
||||||
final int[] results = sWm.mRoot.setDisplayOverrideConfigurationIfNeeded(override,
|
final int[] results = sWm.mRoot.setDisplayOverrideConfigurationIfNeeded(override,
|
||||||
mDisplayContent.getDisplayId());
|
mDisplayContent.getDisplayId());
|
||||||
|
|
||||||
// Ensure only first stack is returned.
|
// Ensure only first stack is returned.
|
||||||
assertTrue(results.length == 1);
|
assertTrue(results.length == 1);
|
||||||
assertTrue(results[0] == stack.mStackId);
|
assertTrue(results[0] == stack.mStackId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user