diff options
author | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-22 22:15:54 +0000 |
---|---|---|
committer | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-22 22:15:54 +0000 |
commit | 369ae9feac83d20ebc57c4b25b772c248a24233d (patch) | |
tree | b2b163a0484032399dfe03d12c4dad51857273d1 /chrome/test | |
parent | 430ee7fe6b5d48a87baba48a2da8a600f3e1d298 (diff) | |
download | chromium_src-369ae9feac83d20ebc57c4b25b772c248a24233d.zip chromium_src-369ae9feac83d20ebc57c4b25b772c248a24233d.tar.gz chromium_src-369ae9feac83d20ebc57c4b25b772c248a24233d.tar.bz2 |
Refactor the detection of sync initialization after browser restart
The pyauto sync test that restarts the browser was failing in the step
where it waited on sync cycle completion because of a recent change
in the syncer thread design that resulted in a full sync cycle not
occurring on browser restart.
This patch does a couple of things:
- Makes sure that the sync backend is initialized before waiting for
a sync cycle completion.
- Adds a method called AwaitSyncRestart, to be used in cases where
the browser is restarted and a full sync cycle is not expected to occur.
BUG=79894, 80020, 80247
TEST=sync.SyncTest.testRestartBrowser
Review URL: http://codereview.chromium.org/6898003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82730 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/functional/PYAUTO_TESTS | 10 | ||||
-rw-r--r-- | chrome/test/functional/sync.py | 2 | ||||
-rw-r--r-- | chrome/test/pyautolib/pyauto.py | 16 |
3 files changed, 20 insertions, 8 deletions
diff --git a/chrome/test/functional/PYAUTO_TESTS b/chrome/test/functional/PYAUTO_TESTS index 8530b73..e71d966 100644 --- a/chrome/test/functional/PYAUTO_TESTS +++ b/chrome/test/functional/PYAUTO_TESTS @@ -100,12 +100,9 @@ 'special_tabs', # crbug.com/67851 '-special_tabs.SpecialTabsTest.testAboutDNSTab', + 'sync', 'test_basic', 'themes', - 'sync', - # crbug.com/80020 - '-sync.SyncTest.testDisableAndEnableDatatype', - '-sync.SyncTest.testRestartBrowser', ], 'win': [ @@ -154,9 +151,6 @@ '-search_engines.SearchEnginesTest.testDiscoverSearchEngine', # Keychain popups make sync tests difficult on Mac. crbug.com/49378 '-sync', - # crbug.com/78863 - '-sync.SyncTest.testDisableAndEnableDatatype', - '-sync.SyncTest.testSignInToSync', ], 'linux': [ # linux != chromeos @@ -169,6 +163,8 @@ # crbug.com/70694 '-passwords.PasswordTest.testInfoBarDisappearByReload', '-passwords.PasswordTest.testNeverSavePasswords', + # Gnome / kwallet popups on linux break sync tests. crbug.com/80329 + '-sync', ], # ChromeOS is linux, but note that this section does not include the diff --git a/chrome/test/functional/sync.py b/chrome/test/functional/sync.py index cfa82282..72eec1a 100644 --- a/chrome/test/functional/sync.py +++ b/chrome/test/functional/sync.py @@ -49,7 +49,7 @@ class SyncTest(pyauto.PyUITest): self.assertTrue(self.GetSyncInfo()['summary'] == 'READY') self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now') self.RestartBrowser(clear_profile=False) - self.assertTrue(self.AwaitSyncCycleCompletion()) + self.assertTrue(self.AwaitSyncRestart()) self.assertTrue(self.GetSyncInfo()['summary'] == 'READY') self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now') self.assertTrue(self.GetSyncInfo()['updates received'] == 0) diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py index ee2074a..7ea43cb 100644 --- a/chrome/test/pyautolib/pyauto.py +++ b/chrome/test/pyautolib/pyauto.py @@ -1994,6 +1994,22 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): } return self._GetResultFromJSONRequest(cmd_dict)['success'] + def AwaitSyncRestart(self): + """Waits for sync to reinitialize itself. Typically used when the browser + is restarted and a full sync cycle is not expected to occur. Must be + previously signed in to sync before calling this method. + + Returns: + True, on success. + + Raises: + pyauto_errors.JSONInterfaceError if the automation call returns an error. + """ + cmd_dict = { + 'command': 'AwaitSyncRestart', + } + return self._GetResultFromJSONRequest(cmd_dict)['success'] + def EnableSyncForDatatypes(self, datatypes): """Enables sync for a given list of sync datatypes. Must be signed in to sync before calling this method. |