OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 import os | 4 import os |
5 import unittest | 5 import unittest |
6 | 6 |
7 from telemetry import browser_finder | 7 from telemetry.core import browser_finder |
8 from telemetry import simple_mock | 8 from telemetry.test import simple_mock |
9 from telemetry import options_for_unittests | 9 from telemetry.test import options_for_unittests |
10 | 10 |
11 _ = simple_mock.DONT_CARE | 11 _ = simple_mock.DONT_CARE |
12 | 12 |
13 class FormBasedCredentialsBackendUnitTestBase(unittest.TestCase): | 13 class FormBasedCredentialsBackendUnitTestBase(unittest.TestCase): |
14 def setUp(self): | 14 def setUp(self): |
15 self._credentials_type = None | 15 self._credentials_type = None |
16 | 16 |
17 def testRealLoginIfPossible(self): | 17 def testRealLoginIfPossible(self): |
18 credentials_path = os.path.join( | 18 credentials_path = os.path.join( |
19 os.path.dirname(__file__), | 19 os.path.dirname(__file__), |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 tab.ExpectCall('ExecuteJavaScript', _).WhenCalled(VerifyPw) | 104 tab.ExpectCall('ExecuteJavaScript', _).WhenCalled(VerifyPw) |
105 | 105 |
106 def VerifySubmit(js): | 106 def VerifySubmit(js): |
107 assert '.submit' in js | 107 assert '.submit' in js |
108 tab.ExpectCall('ExecuteJavaScript', _).WhenCalled(VerifySubmit) | 108 tab.ExpectCall('ExecuteJavaScript', _).WhenCalled(VerifySubmit) |
109 | 109 |
110 # Checking for form still up. | 110 # Checking for form still up. |
111 tab.ExpectCall('EvaluateJavaScript', _).WillReturn(False) | 111 tab.ExpectCall('EvaluateJavaScript', _).WillReturn(False) |
112 | 112 |
113 backend.LoginNeeded(tab, config) | 113 backend.LoginNeeded(tab, config) |
OLD | NEW |