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

Unified Diff: tools/chrome_remote_control/chrome_remote_control/browser_credentials_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/browser_credentials_unittest.py
diff --git a/tools/chrome_remote_control/chrome_remote_control/browser_credentials_unittest.py b/tools/chrome_remote_control/chrome_remote_control/browser_credentials_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..d0f9336a1ba640ab67da8de7c80a4c1bd34dc6a4
--- /dev/null
+++ b/tools/chrome_remote_control/chrome_remote_control/browser_credentials_unittest.py
@@ -0,0 +1,36 @@
+# 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
+import tempfile
+
+from chrome_remote_control import browser_credentials
+
+simple_config_string = """
+{
+ "google_username": "example",
+ "google_password": "asdf",
+
+ "google_account_url": null,
+
+
+ "othersite_username": "test",
+ "othersite_password": "1234"
+}
+"""
+
+desired_config = {'google_username':None, 'othersite_password':None}
+
+result_config = {'google_username':'example', 'othersite_password':'1234'}
+
+class TestBrowserCredentials(unittest.TestCase):
+ def testGetConfig(self):
+ browser_cred = browser_credentials.BrowserCredentials()
+ with tempfile.NamedTemporaryFile() as f:
+ f.write(simple_config_string)
+ f.flush()
+
+ browser_cred.SetCredentialsConfigFile(f.name)
+ config = browser_cred.GetConfig(desired_config)
+
+ self.assertEqual(config, result_config)

Powered by Google App Engine
This is Rietveld 408576698