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, utils |
6 from autotest_lib.client.bin import chromeos_constants, site_cryptohome | 6 from autotest_lib.client.bin import site_cryptohome |
7 from autotest_lib.client.common_lib import error, site_httpd | 7 from autotest_lib.client.common_lib import error, site_httpd |
| 8 from autotest_lib.client.cros import constants as chromeos_constants |
8 | 9 |
9 class GoogleAuthServer(object): | 10 class GoogleAuthServer(object): |
10 """A mock Google accounts server that can be run in a separate thread | 11 """A mock Google accounts server that can be run in a separate thread |
11 during autotests. By default, it returns happy-signals, accepting any | 12 during autotests. By default, it returns happy-signals, accepting any |
12 credentials. | 13 credentials. |
13 """ | 14 """ |
14 | 15 |
15 sid = '1234' | 16 sid = '1234' |
16 lsid = '5678' | 17 lsid = '5678' |
17 token = 'aaaa' | 18 token = 'aaaa' |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 if not 'continue' in url_args: | 130 if not 'continue' in url_args: |
130 raise error.TestError('TokenAuth called with no continue param') | 131 raise error.TestError('TokenAuth called with no continue param') |
131 handler.send_response(httplib.SEE_OTHER) | 132 handler.send_response(httplib.SEE_OTHER) |
132 handler.send_header('Location', url_args['continue'][0]) | 133 handler.send_header('Location', url_args['continue'][0]) |
133 handler.end_headers() | 134 handler.end_headers() |
134 | 135 |
135 | 136 |
136 def __test_over_responder(self, handler, url_args): | 137 def __test_over_responder(self, handler, url_args): |
137 handler.send_response(httplib.OK) | 138 handler.send_response(httplib.OK) |
138 handler.end_headers() | 139 handler.end_headers() |
OLD | NEW |