| Index: chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java
|
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java
|
| index c4529081d8e49c31246a5f78a427c772511b7a57..9330492c1965f277c8f3d59c752e818cd3f9cec1 100644
|
| --- a/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java
|
| +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java
|
| @@ -1694,8 +1694,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
|
| File incognitoTabFile = new File(tabStateDir,
|
| TabState.getTabStateFilename(incognitoModel.getTabAt(0).getId(), true));
|
|
|
| - assertTrue(normalTabFile.getAbsolutePath(), normalTabFile.exists());
|
| - assertTrue(incognitoTabFile.getAbsolutePath(), incognitoTabFile.exists());
|
| + assertFileExists(normalTabFile, true);
|
| + assertFileExists(incognitoTabFile, true);
|
|
|
| // Although we're destroying the activity, the Application will still live on since its in
|
| // the same process as this test.
|
| @@ -1703,8 +1703,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
|
|
|
| // Activity will be started without a savedInstanceState.
|
| startMainActivityOnBlankPage();
|
| - assertTrue(normalTabFile.exists());
|
| - assertFalse(incognitoTabFile.exists());
|
| + assertFileExists(normalTabFile, true);
|
| + assertFileExists(incognitoTabFile, false);
|
| }
|
|
|
| @Override
|
| @@ -1722,4 +1722,15 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
|
| }
|
| startMainActivityFromLauncher();
|
| }
|
| +
|
| + private void assertFileExists(final File fileToCheck, final boolean expected)
|
| + throws InterruptedException {
|
| + CriteriaHelper.pollInstrumentationThread(
|
| + Criteria.equals(expected, new Callable<Boolean>() {
|
| + @Override
|
| + public Boolean call() {
|
| + return fileToCheck.exists();
|
| + }
|
| + }));
|
| + }
|
| }
|
|
|