Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: net/tools/testserver/testserver.py

Issue 74253002: Stop using third_party\python_26 for many tests. (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Do not use system version at all Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 17 matching lines...) Expand all
28 import socket 28 import socket
29 import SocketServer 29 import SocketServer
30 import struct 30 import struct
31 import sys 31 import sys
32 import threading 32 import threading
33 import time 33 import time
34 import urllib 34 import urllib
35 import urlparse 35 import urlparse
36 import zlib 36 import zlib
37 37
38 BASE_DIR = os.path.dirname(os.path.abspath(__file__))
39 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(BASE_DIR)))
40
41
42 # Insert at the beginning of the path, we want these to be used
43 # unconditionally.
44 sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party', 'tlslite'))
45 sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party', 'pyftpdlib', 'src'))
46 sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party', 'pywebsocket', 'src'))
47
38 import echo_message 48 import echo_message
39 import pyftpdlib.ftpserver 49 import pyftpdlib.ftpserver
40 import testserver_base 50 import testserver_base
41 import tlslite 51 import tlslite
42 import tlslite.api 52 import tlslite.api
43 53
44 BASE_DIR = os.path.dirname(os.path.abspath(__file__))
45 sys.path.insert(
46 0, os.path.join(BASE_DIR, '..', '..', '..', 'third_party/pywebsocket/src'))
47 from mod_pywebsocket.standalone import WebSocketServer 54 from mod_pywebsocket.standalone import WebSocketServer
48 55
49 SERVER_HTTP = 0 56 SERVER_HTTP = 0
50 SERVER_FTP = 1 57 SERVER_FTP = 1
51 SERVER_TCP_ECHO = 2 58 SERVER_TCP_ECHO = 2
52 SERVER_UDP_ECHO = 3 59 SERVER_UDP_ECHO = 3
53 SERVER_BASIC_AUTH_PROXY = 4 60 SERVER_BASIC_AUTH_PROXY = 4
54 SERVER_WEBSOCKET = 5 61 SERVER_WEBSOCKET = 5
55 62
56 # Default request queue size for WebSocketServer. 63 # Default request queue size for WebSocketServer.
(...skipping 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after
2095 '"aes128", "3des", "rc4". If omitted, all ' 2102 '"aes128", "3des", "rc4". If omitted, all '
2096 'algorithms will be used. This option may ' 2103 'algorithms will be used. This option may '
2097 'appear multiple times, indicating ' 2104 'appear multiple times, indicating '
2098 'multiple algorithms should be enabled.'); 2105 'multiple algorithms should be enabled.');
2099 self.option_parser.add_option('--file-root-url', default='/files/', 2106 self.option_parser.add_option('--file-root-url', default='/files/',
2100 help='Specify a root URL for files served.') 2107 help='Specify a root URL for files served.')
2101 2108
2102 2109
2103 if __name__ == '__main__': 2110 if __name__ == '__main__':
2104 sys.exit(ServerRunner().main()) 2111 sys.exit(ServerRunner().main())
OLDNEW
« net/test/python_utils.cc ('K') | « net/test/spawned_test_server/local_test_server_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698