1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SAFE_BROWSING_LOCAL_SAFEBROWSING_TEST_SERVER_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_LOCAL_SAFEBROWSING_TEST_SERVER_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/files/file_path.h"
11 #include "net/test/spawned_test_server/local_test_server.h"
13 // Runs a Python-based safebrowsing test server on the same machine in which the
14 // LocalSafeBrowsingTestServer runs.
15 class LocalSafeBrowsingTestServer
: public net::LocalTestServer
{
17 // Initialize a safebrowsing server using the given |data_file|.
18 explicit LocalSafeBrowsingTestServer(const base::FilePath
& data_file
);
20 virtual ~LocalSafeBrowsingTestServer();
22 virtual bool SetPythonPath() const OVERRIDE
;
24 // Returns the path to safe_browsing_testserver.py.
25 virtual bool GetTestServerPath(
26 base::FilePath
* testserver_path
) const OVERRIDE
;
29 // Adds the --data-file switch. Returns true on success.
30 virtual bool GenerateAdditionalArguments(
31 base::DictionaryValue
* arguments
) const OVERRIDE
;
34 base::FilePath data_file_
;
36 DISALLOW_COPY_AND_ASSIGN(LocalSafeBrowsingTestServer
);
39 #endif // CHROME_BROWSER_SAFE_BROWSING_LOCAL_SAFEBROWSING_TEST_SERVER_H_