diff options
author | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-10 06:05:15 +0000 |
---|---|---|
committer | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-10 06:05:15 +0000 |
commit | c8c262b4dad5473c7563dc4e8d9cb69f117682ef (patch) | |
tree | dc05332f96d4312c7eed73e04dafaaea5c9e781e /chrome/test | |
parent | 9c7baaef685eb19e5dc013f491a671630d9679f4 (diff) | |
download | chromium_src-c8c262b4dad5473c7563dc4e8d9cb69f117682ef.zip chromium_src-c8c262b4dad5473c7563dc4e8d9cb69f117682ef.tar.gz chromium_src-c8c262b4dad5473c7563dc4e8d9cb69f117682ef.tar.bz2 |
Add facilities to fetch username/passwd credentials from private data
Fetch username/passwd from private data and use in sync tests.
BUG=60970
Review URL: http://codereview.chromium.org/4738004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65634 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/functional/sync.py | 18 | ||||
-rw-r--r-- | chrome/test/pyautolib/pyauto.py | 11 |
2 files changed, 20 insertions, 9 deletions
diff --git a/chrome/test/functional/sync.py b/chrome/test/functional/sync.py index fc9dd074..fb1a4c1 100644 --- a/chrome/test/functional/sync.py +++ b/chrome/test/functional/sync.py @@ -12,9 +12,9 @@ class SyncTest(pyauto.PyUITest): def testSignInToSync(self): """Sign in to sync.""" - # Need to initialize username and password. See crbug.com/60970. - username = '<username>@gmail.com' - password = '<password>' + creds = self.GetPrivateInfo()['test_google_account'] + username = creds['username'] + password = creds['password'] self.assertTrue(self.GetSyncInfo()['summary'] == 'OFFLINE_UNUSABLE') self.assertTrue(self.GetSyncInfo()['last synced'] == 'Never') self.assertTrue(self.SignInToSync(username, password)) @@ -23,9 +23,9 @@ class SyncTest(pyauto.PyUITest): 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>' + creds = self.GetPrivateInfo()['test_google_account'] + username = creds['username'] + password = creds['password'] self.assertTrue(self.SignInToSync(username, password)) self.assertTrue(self.GetSyncInfo()['summary'] == 'READY') self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now') @@ -36,9 +36,9 @@ class SyncTest(pyauto.PyUITest): 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>' + creds = self.GetPrivateInfo()['test_google_account'] + username = creds['username'] + password = creds['password'] self.assertTrue(self.SignInToSync(username, password)) self.assertTrue(self.GetSyncInfo()['summary'] == 'READY') self.assertTrue(self.GetSyncInfo()['last synced'] == 'Just now') diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py index 815415a..a0a7c47 100644 --- a/chrome/test/pyautolib/pyauto.py +++ b/chrome/test/pyautolib/pyauto.py @@ -259,6 +259,17 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): else: os.kill(pid, signal.SIGTERM) + def GetPrivateInfo(self): + """Fetch info from private_tests_info.txt in private dir. + + Returns: + a dictionary of items from private_tests_info.txt + """ + private_file = os.path.join( + self.DataDir(), 'private', 'private_tests_info.txt') + assert os.path.exists(private_file), '%s missing' % private_file + return self.EvalDataFrom(private_file) + def WaitUntil(self, function, timeout=-1, retry_sleep=0.25, args=[], expect_retval=None): """Poll on a condition until timeout. |