OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 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 """Wraps the upstream safebrowsing_test_server.py to run in Chrome tests.""" | 6 """Wraps the upstream safebrowsing_test_server.py to run in Chrome tests.""" |
7 | 7 |
8 import os | 8 import os |
9 import sys | 9 import sys |
10 | 10 |
11 BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | 11 BASE_DIR = os.path.dirname(os.path.abspath(__file__)) |
12 | 12 |
(...skipping 15 matching lines...) Expand all Loading... |
28 print 'Safebrowsing HTTP server started on port %d...' % server.server_port | 28 print 'Safebrowsing HTTP server started on port %d...' % server.server_port |
29 server_data['port'] = server.server_port | 29 server_data['port'] = server.server_port |
30 | 30 |
31 return server | 31 return server |
32 | 32 |
33 def add_options(self): | 33 def add_options(self): |
34 testserver_base.TestServerRunner.add_options(self) | 34 testserver_base.TestServerRunner.add_options(self) |
35 self.option_parser.add_option('--data-file', dest='data_file', | 35 self.option_parser.add_option('--data-file', dest='data_file', |
36 help='File containing safebrowsing test ' | 36 help='File containing safebrowsing test ' |
37 'data and expectations') | 37 'data and expectations') |
38 # TODO(mattm): we define an unnecessary --data-dir option because | |
39 # BaseTestServer unconditionally sets --data-dir. This should be removed | |
40 # when BaseTestServer is refactored to not contain all the net/ | |
41 # test_server.py specific stuff. | |
42 self.option_parser.add_option('--data-dir', dest='data_dir', | |
43 help='unused') | |
44 | 38 |
45 | 39 |
46 if __name__ == '__main__': | 40 if __name__ == '__main__': |
47 sys.exit(ServerRunner().main()) | 41 sys.exit(ServerRunner().main()) |
OLD | NEW |