OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS 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 httplib, logging, os, socket, stat, time, utils | 5 import httplib, logging, os, socket, stat, time |
6 | 6 |
7 import common | 7 import common |
8 import constants as chromeos_constants, cryptohome, httpd | 8 import constants as chromeos_constants, cryptohome, httpd |
| 9 from autotest_lib.client.bin import utils |
9 from autotest_lib.client.common_lib import error | 10 from autotest_lib.client.common_lib import error |
10 | 11 |
11 | 12 |
12 class GoogleAuthServer(object): | 13 class GoogleAuthServer(object): |
13 """A mock Google accounts server that can be run in a separate thread | 14 """A mock Google accounts server that can be run in a separate thread |
14 during autotests. By default, it returns happy-signals, accepting any | 15 during autotests. By default, it returns happy-signals, accepting any |
15 credentials. | 16 credentials. |
16 """ | 17 """ |
17 | 18 |
18 sid = '1234' | 19 sid = '1234' |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 if not 'continue' in url_args: | 133 if not 'continue' in url_args: |
133 raise error.TestError('TokenAuth called with no continue param') | 134 raise error.TestError('TokenAuth called with no continue param') |
134 handler.send_response(httplib.SEE_OTHER) | 135 handler.send_response(httplib.SEE_OTHER) |
135 handler.send_header('Location', url_args['continue'][0]) | 136 handler.send_header('Location', url_args['continue'][0]) |
136 handler.end_headers() | 137 handler.end_headers() |
137 | 138 |
138 | 139 |
139 def __test_over_responder(self, handler, url_args): | 140 def __test_over_responder(self, handler, url_args): |
140 handler.send_response(httplib.OK) | 141 handler.send_response(httplib.OK) |
141 handler.end_headers() | 142 handler.end_headers() |
OLD | NEW |