| 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)
|
|
|