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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_testserver.py

Issue 10073033: Run safebrowsing_service_test through the net testserver code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits, fail fix Created 8 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_test.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """Wraps the upstream safebrowsing_test_server.py to run in Chrome tests."""
7
8 import os
9 import sys
10
11 BASE_DIR = os.path.dirname(os.path.abspath(__file__))
12
13 sys.path.append(os.path.join(BASE_DIR, '..', '..', '..', 'net',
14 'tools', 'testserver'))
15 import testserver_base
16
17
18 class ServerRunner(testserver_base.TestServerRunner):
Nico 2012/09/04 20:11:20 docstring
19 def create_server(self, server_data):
20 sys.path.append(os.path.join(BASE_DIR, '..', '..', '..', 'third_party',
21 'safe_browsing', 'testing'))
22 import safebrowsing_test_server
23 server = safebrowsing_test_server.SetupServer(
24 self.options.data_file, self.options.host, self.options.port,
25 opt_enforce_caching=False, opt_validate_database=True)
26 print 'Safebrowsing HTTP server started on port %d...' % server.server_port
27 server_data['port'] = server.server_port
28
29 return server
30
31 def add_options(self):
32 testserver_base.TestServerRunner.add_options(self)
33 self.option_parser.add_option('--data-file', dest='data_file',
34 help='File containing safebrowsing test '
35 'data and expectations')
36 # TODO(mattm): we define an unnecessary --data-dir option because
37 # BaseTestServer unconditionally sets --data-dir. This should be removed
38 # when BaseTestServer is refactored to not contain all the net/
39 # test_server.py specific stuff.
40 self.option_parser.add_option('--data-dir', dest='data_dir',
41 help='unused')
42
43
44 if __name__ == '__main__':
45 sys.exit(ServerRunner().main())
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_test.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698