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

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..cae03b2d488ce17d6548cd7eae640e8e4cca60f2
--- /dev/null
+++ b/tools/chrome_remote_control/chrome_remote_control/google_credentials_backend_unittest.py
@@ -0,0 +1,33 @@
+# 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 google_credentials_backend
+from chrome_remote_control import credentials_backend
+from chrome_remote_control import credentials_backend_unittest
+
+class TestGoogleCredentialsBackend(unittest.TestCase):
+ def testGoogleAccountsLogin(self):
+ gcb = google_credentials_backend.GoogleCredentialsBackend()
+ possible_browser = credentials_backend_unittest.getPossibleBrowser()
+ self.assertIsNotNone(possible_browser)
+
+ credentials_backend.CredentialsBackend.SetCredentialsConfigFile(
+ credentials_backend_unittest.google_credentials_file)
+ credentials_backend.CredentialsBackend.ResetConfig()
+ try:
+ config = credentials_backend.CredentialsBackend.GetConfig(
+ credentials_backend_unittest.google_credentials)
+ except IOError:
+ self.skipTest('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