Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5170)

Unified Diff: chrome/test/functional/sync.py

Issue 4096004: PyAuto hooks for Sync in TestingAutomationProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase; Addressing final review comment. Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/functional/PYAUTO_TESTS ('k') | chrome/test/live_sync/live_sync_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/sync.py
diff --git a/chrome/test/functional/sync.py b/chrome/test/functional/sync.py
new file mode 100644
index 0000000000000000000000000000000000000000..fc9dd074ed8e7cdb44d1a91c3e7882acff18fa5f
--- /dev/null
+++ b/chrome/test/functional/sync.py
@@ -0,0 +1,52 @@
+#!/usr/bin/python
+# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import pyauto_functional # Must be imported before pyauto
+import pyauto
+
+
+class SyncTest(pyauto.PyUITest):
+ """Tests for sync."""
+
+ def testSignInToSync(self):
+ """Sign in to sync."""
+ # Need to initialize username and password. See crbug.com/60970.
+ username = '<username>@gmail.com'
+ password = '<password>'
+ self.assertTrue(self.GetSyncInfo()['summary'] == 'OFFLINE_UNUSABLE')
+ self.assertTrue(self.GetSyncInfo()['last synced'] == 'Never')
+ self.assertTrue(self.SignInToSync(username, password))
+ self.assertTrue(self.GetSyncInfo()['summary'] == 'READY')
+ self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now')
+
+ def testDisableAndEnableDatatype(self):
+ """Sign in, disable and then enable sync for a datatype."""
+ # Need to initialize username and password. See crbug.com/60970.
+ username = '<username>@gmail.com'
+ password = '<password>'
+ self.assertTrue(self.SignInToSync(username, password))
+ self.assertTrue(self.GetSyncInfo()['summary'] == 'READY')
+ self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now')
+ self.assertTrue(self.DisableSyncForDatatypes(['Bookmarks']))
+ self.assertFalse('Bookmarks' in self.GetSyncInfo()['synced datatypes'])
+ self.assertTrue(self.EnableSyncForDatatypes(['Bookmarks']))
+ self.assertTrue('Bookmarks' in self.GetSyncInfo()['synced datatypes'])
+
+ def testRestartBrowser(self):
+ """Sign in to sync and restart the browser."""
+ # Need to initialize username and password. See crbug.com/60970.
+ username = '<username>@gmail.com'
+ password = '<password>'
+ self.assertTrue(self.SignInToSync(username, password))
+ 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.GetSyncInfo()['summary'] == 'READY')
+ self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now')
+
+
+if __name__ == '__main__':
+ pyauto_functional.Main()
« no previous file with comments | « chrome/test/functional/PYAUTO_TESTS ('k') | chrome/test/live_sync/live_sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698