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

Unified Diff: tools/chrome_remote_control/chrome_remote_control/google_credentials_backend_unittest.py

Issue 10914237: Port perf.py's _LoginToGoogleAccount to chrome_remote_control (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months 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
Index: tools/chrome_remote_control/chrome_remote_control/google_credentials_backend_unittest.py
diff --git a/tools/chrome_remote_control/chrome_remote_control/google_credentials_backend_unittest.py b/tools/chrome_remote_control/chrome_remote_control/google_credentials_backend_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..ed114a1daa89e5d684880a4f0b012df06c9ccc08
--- /dev/null
+++ b/tools/chrome_remote_control/chrome_remote_control/google_credentials_backend_unittest.py
@@ -0,0 +1,34 @@
+# Copyright (c) 2012 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 unittest
+
+from chrome_remote_control import browser_credentials
+from chrome_remote_control import google_credentials_backend
+from chrome_remote_control import credentials_backend_unittest
+
+class TestGoogleCredentialsBackend(unittest.TestCase):
+ def testGoogleAccountsLogin(self):
+ browser_cred = browser_credentials.BrowserCredentials()
+ gcb = google_credentials_backend.GoogleCredentialsBackend(browser_cred)
+ possible_browser = credentials_backend_unittest.getPossibleBrowser()
+ self.assertIsNotNone(possible_browser) # pylint: disable=E1101
+
+ browser_cred.SetCredentialsConfigFile(
+ credentials_backend_unittest.google_credentials_file)
+ try:
+ config = browser_cred.GetConfig(
+ credentials_backend_unittest.google_credentials)
+ except IOError:
+ self.skipTest( # pylint: disable=E1101
+ 'Google Credentials File Not Found: "%s"' %
+ credentials_backend_unittest.google_credentials_file)
+
+ with possible_browser.Create() as browser:
+ with browser.ConnectToNthTab(0) as tab:
+ username = config['google_username']
+ password = config['google_password']
+
+ gcb.GoogleAccountsLogin(username, password, tab,
+ config['google_account_url'])
+ credentials_backend_unittest.waitForExist('nav-privacy', tab)

Powered by Google App Engine
This is Rietveld 408576698