| Index: chrome/test/telemetry/chromeos/login_unittest.py
|
| diff --git a/chrome/test/telemetry/chromeos/login_unittest.py b/chrome/test/telemetry/chromeos/login_unittest.py
|
| index 415351d8a399356017669533634d4b3afc4f0d0f..04339908d332580a9f622cd83158287692b923ac 100644
|
| --- a/chrome/test/telemetry/chromeos/login_unittest.py
|
| +++ b/chrome/test/telemetry/chromeos/login_unittest.py
|
| @@ -29,22 +29,23 @@ class CrOSAutoTest(unittest.TestCase):
|
| return (cryptohomeStatus['mounts'] and
|
| cryptohomeStatus['mounts'][0]['mounted'])
|
|
|
| - def _CreateBrowser(self, with_autotest_ext):
|
| - """Finds and creates a browser for tests. if with_autotest_ext is True,
|
| + def _CreateBrowser(self, autotest_ext=False, auto_login=True):
|
| + """Finds and creates a browser for tests. if autotest_ext is True,
|
| also loads the autotest extension"""
|
| options = options_for_unittests.GetCopy()
|
|
|
| - if with_autotest_ext:
|
| + if autotest_ext:
|
| extension_path = os.path.join(os.path.dirname(__file__), 'autotest_ext')
|
| self._load_extension = extension_to_load.ExtensionToLoad(
|
| path=extension_path,
|
| browser_type=options.browser_type,
|
| is_component=True)
|
| options.extensions_to_load = [self._load_extension]
|
| - options.browser_options.create_browser_with_oobe = True
|
|
|
| browser_to_create = browser_finder.FindBrowser(options)
|
| self.assertTrue(browser_to_create)
|
| + options.browser_options.create_browser_with_oobe = True
|
| + options.browser_options.auto_login = auto_login
|
| b = browser_to_create.Create()
|
| b.Start()
|
| return b
|
| @@ -71,7 +72,7 @@ class CrOSAutoTest(unittest.TestCase):
|
| def testCryptohomeMounted(self):
|
| """Verifies cryptohome mount status for regular and guest user and when
|
| logged out"""
|
| - with self._CreateBrowser(False) as b:
|
| + with self._CreateBrowser() as b:
|
| self.assertEquals(1, len(b.tabs))
|
| self.assertTrue(b.tabs[0].url)
|
| self.assertTrue(self._IsCryptohomeMounted())
|
| @@ -92,7 +93,7 @@ class CrOSAutoTest(unittest.TestCase):
|
|
|
| def testLoginStatus(self):
|
| """Tests autotestPrivate.loginStatus"""
|
| - with self._CreateBrowser(True) as b:
|
| + with self._CreateBrowser(autotest_ext=True) as b:
|
| login_status = self._GetLoginStatus(b)
|
| self.assertEquals(type(login_status), dict)
|
|
|
| @@ -145,7 +146,7 @@ class CrOSAutoTest(unittest.TestCase):
|
|
|
| def testScreenLock(self):
|
| """Tests autotestPrivate.screenLock"""
|
| - with self._CreateBrowser(True) as browser:
|
| + with self._CreateBrowser(autotest_ext=True) as browser:
|
| self._LockScreen(browser)
|
| self._AttemptUnlockBadPassword(browser)
|
| self._UnlockScreen(browser)
|
| @@ -153,7 +154,7 @@ class CrOSAutoTest(unittest.TestCase):
|
|
|
| def testLogout(self):
|
| """Tests autotestPrivate.logout"""
|
| - with self._CreateBrowser(True) as b:
|
| + with self._CreateBrowser(autotest_ext=True) as b:
|
| extension = self._GetAutotestExtension(b)
|
| try:
|
| extension.ExecuteJavaScript('chrome.autotestPrivate.logout();')
|
|
|