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

Side by Side Diff: chrome/test/functional/sync.py

Issue 4738004: Add facilities to fetch username/passwd credentials from private data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test_google_account 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/pyautolib/pyauto.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import pyauto_functional # Must be imported before pyauto 6 import pyauto_functional # Must be imported before pyauto
7 import pyauto 7 import pyauto
8 8
9 9
10 class SyncTest(pyauto.PyUITest): 10 class SyncTest(pyauto.PyUITest):
11 """Tests for sync.""" 11 """Tests for sync."""
12 12
13 def testSignInToSync(self): 13 def testSignInToSync(self):
14 """Sign in to sync.""" 14 """Sign in to sync."""
15 # Need to initialize username and password. See crbug.com/60970. 15 creds = self.GetPrivateInfo()['test_google_account']
16 username = '<username>@gmail.com' 16 username = creds['username']
17 password = '<password>' 17 password = creds['password']
18 self.assertTrue(self.GetSyncInfo()['summary'] == 'OFFLINE_UNUSABLE') 18 self.assertTrue(self.GetSyncInfo()['summary'] == 'OFFLINE_UNUSABLE')
19 self.assertTrue(self.GetSyncInfo()['last synced'] == 'Never') 19 self.assertTrue(self.GetSyncInfo()['last synced'] == 'Never')
20 self.assertTrue(self.SignInToSync(username, password)) 20 self.assertTrue(self.SignInToSync(username, password))
21 self.assertTrue(self.GetSyncInfo()['summary'] == 'READY') 21 self.assertTrue(self.GetSyncInfo()['summary'] == 'READY')
22 self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now') 22 self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now')
23 23
24 def testDisableAndEnableDatatype(self): 24 def testDisableAndEnableDatatype(self):
25 """Sign in, disable and then enable sync for a datatype.""" 25 """Sign in, disable and then enable sync for a datatype."""
26 # Need to initialize username and password. See crbug.com/60970. 26 creds = self.GetPrivateInfo()['test_google_account']
27 username = '<username>@gmail.com' 27 username = creds['username']
28 password = '<password>' 28 password = creds['password']
29 self.assertTrue(self.SignInToSync(username, password)) 29 self.assertTrue(self.SignInToSync(username, password))
30 self.assertTrue(self.GetSyncInfo()['summary'] == 'READY') 30 self.assertTrue(self.GetSyncInfo()['summary'] == 'READY')
31 self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now') 31 self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now')
32 self.assertTrue(self.DisableSyncForDatatypes(['Bookmarks'])) 32 self.assertTrue(self.DisableSyncForDatatypes(['Bookmarks']))
33 self.assertFalse('Bookmarks' in self.GetSyncInfo()['synced datatypes']) 33 self.assertFalse('Bookmarks' in self.GetSyncInfo()['synced datatypes'])
34 self.assertTrue(self.EnableSyncForDatatypes(['Bookmarks'])) 34 self.assertTrue(self.EnableSyncForDatatypes(['Bookmarks']))
35 self.assertTrue('Bookmarks' in self.GetSyncInfo()['synced datatypes']) 35 self.assertTrue('Bookmarks' in self.GetSyncInfo()['synced datatypes'])
36 36
37 def testRestartBrowser(self): 37 def testRestartBrowser(self):
38 """Sign in to sync and restart the browser.""" 38 """Sign in to sync and restart the browser."""
39 # Need to initialize username and password. See crbug.com/60970. 39 creds = self.GetPrivateInfo()['test_google_account']
40 username = '<username>@gmail.com' 40 username = creds['username']
41 password = '<password>' 41 password = creds['password']
42 self.assertTrue(self.SignInToSync(username, password)) 42 self.assertTrue(self.SignInToSync(username, password))
43 self.assertTrue(self.GetSyncInfo()['summary'] == 'READY') 43 self.assertTrue(self.GetSyncInfo()['summary'] == 'READY')
44 self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now') 44 self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now')
45 self.RestartBrowser(clear_profile=False) 45 self.RestartBrowser(clear_profile=False)
46 self.assertTrue(self.AwaitSyncCycleCompletion()) 46 self.assertTrue(self.AwaitSyncCycleCompletion())
47 self.assertTrue(self.GetSyncInfo()['summary'] == 'READY') 47 self.assertTrue(self.GetSyncInfo()['summary'] == 'READY')
48 self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now') 48 self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now')
49 49
50 50
51 if __name__ == '__main__': 51 if __name__ == '__main__':
52 pyauto_functional.Main() 52 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « no previous file | chrome/test/pyautolib/pyauto.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698