diff options
author | pvalenzuela <pvalenzuela@chromium.org> | 2015-05-28 11:30:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-28 18:30:49 +0000 |
commit | 5fc64225562800ed6f81f7f994000d19b2487f08 (patch) | |
tree | e6f7790100de37634e7b46dc8cda65d4597453b9 | |
parent | 3d742d2793e5103d7d59bfd16e97a104a9d33482 (diff) | |
download | chromium_src-5fc64225562800ed6f81f7f994000d19b2487f08.zip chromium_src-5fc64225562800ed6f81f7f994000d19b2487f08.tar.gz chromium_src-5fc64225562800ed6f81f7f994000d19b2487f08.tar.bz2 |
Sync: reduce Android test flakiness caused by page load
This CL prevents unnecessary loading of google.com before Sync tests.
This is wasteful (using both time and networking), but also pollutes
local client data. Instead, about:blank is loaded.
This CL also adds an assert around the clearAppData() call to ensure
that this step succeeds.
BUG=481192
Review URL: https://codereview.chromium.org/1152683002
Cr-Commit-Position: refs/heads/master@{#331825}
-rw-r--r-- | chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTestBase.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTestBase.java b/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTestBase.java index ff97b9e..5dd2f30 100644 --- a/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTestBase.java +++ b/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTestBase.java @@ -43,7 +43,7 @@ public class SyncTestBase extends ChromeShellTestBase { @Override protected void setUp() throws Exception { super.setUp(); - clearAppData(); + assertTrue("Clearing app data failed.", clearAppData()); Context targetContext = getInstrumentation().getTargetContext(); mContext = new SyncTestUtil.SyncTestContext(targetContext); @@ -71,6 +71,13 @@ public class SyncTestBase extends ChromeShellTestBase { mProfileSyncService = ProfileSyncService.get(mContext); } }); + + // Start the activity by opening about:blank. This URL is ideal because it is not synced as + // a typed URL. If another URL is used, it could interfere with test data. This call is in + // this location so that it takes place before any other calls to getActivity(). If + // getActivity() is called without any prior configuration, an undesired URL + // (e.g., google.com) will be opened. + launchChromeShellWithBlankPage(); } @Override |