| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import logging | 5 import logging |
| 6 | 6 |
| 7 from telemetry import benchmark | 7 from telemetry import benchmark |
| 8 from telemetry.core import exceptions | 8 from telemetry.core import exceptions |
| 9 from telemetry.core import util | 9 from telemetry.core import util |
| 10 from telemetry.core.backends.chrome import cros_test_case | 10 from telemetry.core.backends.chrome import cros_test_case |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 self.assertTrue(self._IsScreenLocked(browser)) | 114 self.assertTrue(self._IsScreenLocked(browser)) |
| 115 | 115 |
| 116 def _UnlockScreen(self, browser): | 116 def _UnlockScreen(self, browser): |
| 117 logging.info('Unlocking') | 117 logging.info('Unlocking') |
| 118 browser.oobe.ExecuteJavaScript(''' | 118 browser.oobe.ExecuteJavaScript(''' |
| 119 Oobe.authenticateForTesting('%s', '%s'); | 119 Oobe.authenticateForTesting('%s', '%s'); |
| 120 ''' % (self._username, self._password)) | 120 ''' % (self._username, self._password)) |
| 121 util.WaitFor(lambda: not browser.oobe_exists, 10) | 121 util.WaitFor(lambda: not browser.oobe_exists, 10) |
| 122 self.assertFalse(self._IsScreenLocked(browser)) | 122 self.assertFalse(self._IsScreenLocked(browser)) |
| 123 | 123 |
| 124 @benchmark.Enabled('chromeos') | 124 @benchmark.Disabled |
| 125 def testScreenLock(self): | 125 def testScreenLock(self): |
| 126 """Tests autotestPrivate.screenLock""" | 126 """Tests autotestPrivate.screenLock""" |
| 127 if self._is_guest: | 127 if self._is_guest: |
| 128 return | 128 return |
| 129 with self._CreateBrowser(autotest_ext=True) as browser: | 129 with self._CreateBrowser(autotest_ext=True) as browser: |
| 130 self._LockScreen(browser) | 130 self._LockScreen(browser) |
| 131 self._AttemptUnlockBadPassword(browser) | 131 self._AttemptUnlockBadPassword(browser) |
| 132 self._UnlockScreen(browser) | 132 self._UnlockScreen(browser) |
| OLD | NEW |