Chromium Code Reviews| 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 292 | 292 |
| 293 self._mime_types = { | 293 self._mime_types = { |
| 294 'crx' : 'application/x-chrome-extension', | 294 'crx' : 'application/x-chrome-extension', |
| 295 'exe' : 'application/octet-stream', | 295 'exe' : 'application/octet-stream', |
| 296 'gif': 'image/gif', | 296 'gif': 'image/gif', |
| 297 'jpeg' : 'image/jpeg', | 297 'jpeg' : 'image/jpeg', |
| 298 'jpg' : 'image/jpeg', | 298 'jpg' : 'image/jpeg', |
| 299 'json': 'application/json', | 299 'json': 'application/json', |
| 300 'pdf' : 'application/pdf', | 300 'pdf' : 'application/pdf', |
| 301 'wav' : 'audio/wav', | 301 'wav' : 'audio/wav', |
| 302 'xml' : 'text/xml' | 302 'xml' : 'text/xml', |
| 303 'txt' : 'text/plain' | |
|
Charlie Reis
2013/08/22 18:23:30
nit: Alphabetize.
dsjang
2013/08/22 19:05:55
Done.
| |
| 303 } | 304 } |
| 304 self._default_mime_type = 'text/html' | 305 self._default_mime_type = 'text/html' |
| 305 | 306 |
| 306 testserver_base.BasePageHandler.__init__(self, request, client_address, | 307 testserver_base.BasePageHandler.__init__(self, request, client_address, |
| 307 socket_server, connect_handlers, | 308 socket_server, connect_handlers, |
| 308 get_handlers, head_handlers, | 309 get_handlers, head_handlers, |
| 309 post_handlers, put_handlers) | 310 post_handlers, put_handlers) |
| 310 | 311 |
| 311 def GetMIMETypeFromName(self, file_name): | 312 def GetMIMETypeFromName(self, file_name): |
| 312 """Returns the mime type for the specified file_name. So far it only looks | 313 """Returns the mime type for the specified file_name. So far it only looks |
| (...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2061 '"aes128", "3des", "rc4". If omitted, all ' | 2062 '"aes128", "3des", "rc4". If omitted, all ' |
| 2062 'algorithms will be used. This option may ' | 2063 'algorithms will be used. This option may ' |
| 2063 'appear multiple times, indicating ' | 2064 'appear multiple times, indicating ' |
| 2064 'multiple algorithms should be enabled.'); | 2065 'multiple algorithms should be enabled.'); |
| 2065 self.option_parser.add_option('--file-root-url', default='/files/', | 2066 self.option_parser.add_option('--file-root-url', default='/files/', |
| 2066 help='Specify a root URL for files served.') | 2067 help='Specify a root URL for files served.') |
| 2067 | 2068 |
| 2068 | 2069 |
| 2069 if __name__ == '__main__': | 2070 if __name__ == '__main__': |
| 2070 sys.exit(ServerRunner().main()) | 2071 sys.exit(ServerRunner().main()) |
| OLD | NEW |