| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """This is a simple HTTP/FTP/TCP/UDP/BASIC_AUTH_PROXY/WEBSOCKET server used for | 6 """This is a simple HTTP/FTP/TCP/UDP/BASIC_AUTH_PROXY/WEBSOCKET server used for |
| 7 testing Chrome. | 7 testing Chrome. |
| 8 | 8 |
| 9 It supports several test URLs, as specified by the handlers in TestPageHandler. | 9 It supports several test URLs, as specified by the handlers in TestPageHandler. |
| 10 By default, it listens on an ephemeral port and sends the port number back to | 10 By default, it listens on an ephemeral port and sends the port number back to |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 self.DefaultResponseHandler] | 293 self.DefaultResponseHandler] |
| 294 | 294 |
| 295 self._mime_types = { | 295 self._mime_types = { |
| 296 'crx' : 'application/x-chrome-extension', | 296 'crx' : 'application/x-chrome-extension', |
| 297 'exe' : 'application/octet-stream', | 297 'exe' : 'application/octet-stream', |
| 298 'gif': 'image/gif', | 298 'gif': 'image/gif', |
| 299 'jpeg' : 'image/jpeg', | 299 'jpeg' : 'image/jpeg', |
| 300 'jpg' : 'image/jpeg', | 300 'jpg' : 'image/jpeg', |
| 301 'json': 'application/json', | 301 'json': 'application/json', |
| 302 'pdf' : 'application/pdf', | 302 'pdf' : 'application/pdf', |
| 303 'txt' : 'text/plain', |
| 303 'wav' : 'audio/wav', | 304 'wav' : 'audio/wav', |
| 304 'xml' : 'text/xml' | 305 'xml' : 'text/xml' |
| 305 } | 306 } |
| 306 self._default_mime_type = 'text/html' | 307 self._default_mime_type = 'text/html' |
| 307 | 308 |
| 308 testserver_base.BasePageHandler.__init__(self, request, client_address, | 309 testserver_base.BasePageHandler.__init__(self, request, client_address, |
| 309 socket_server, connect_handlers, | 310 socket_server, connect_handlers, |
| 310 get_handlers, head_handlers, | 311 get_handlers, head_handlers, |
| 311 post_handlers, put_handlers) | 312 post_handlers, put_handlers) |
| 312 | 313 |
| (...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2094 '"aes128", "3des", "rc4". If omitted, all ' | 2095 '"aes128", "3des", "rc4". If omitted, all ' |
| 2095 'algorithms will be used. This option may ' | 2096 'algorithms will be used. This option may ' |
| 2096 'appear multiple times, indicating ' | 2097 'appear multiple times, indicating ' |
| 2097 'multiple algorithms should be enabled.'); | 2098 'multiple algorithms should be enabled.'); |
| 2098 self.option_parser.add_option('--file-root-url', default='/files/', | 2099 self.option_parser.add_option('--file-root-url', default='/files/', |
| 2099 help='Specify a root URL for files served.') | 2100 help='Specify a root URL for files served.') |
| 2100 | 2101 |
| 2101 | 2102 |
| 2102 if __name__ == '__main__': | 2103 if __name__ == '__main__': |
| 2103 sys.exit(ServerRunner().main()) | 2104 sys.exit(ServerRunner().main()) |
| OLD | NEW |