Merge "Fix OOM when running testAddRemoveRace" into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-05-13 12:51:28 +00:00
committed by Android (Google) Code Review

View File

@@ -316,20 +316,16 @@ public class AppWindowTokenTests extends WindowTestsBase {
} }
@Test @Test
@FlakyTest(bugId = 130392471)
public void testAddRemoveRace() { public void testAddRemoveRace() {
// There was once a race condition between adding and removing starting windows // There was once a race condition between adding and removing starting windows
final ActivityRecord appToken = mAppWindow.mActivityRecord;
for (int i = 0; i < 1000; i++) { for (int i = 0; i < 1000; i++) {
final ActivityRecord appToken = createIsolatedTestActivityRecord();
appToken.addStartingWindow(mPackageName, appToken.addStartingWindow(mPackageName,
android.R.style.Theme, null, "Test", 0, 0, 0, 0, null, true, true, false, true, android.R.style.Theme, null, "Test", 0, 0, 0, 0, null, true, true, false, true,
false, false); false, false);
appToken.removeStartingWindow(); appToken.removeStartingWindow();
waitUntilHandlersIdle(); waitUntilHandlersIdle();
assertNoStartingWindow(appToken); assertNoStartingWindow(appToken);
appToken.getParent().getParent().removeImmediately();
} }
} }