OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_TEST_LOCAL_TEST_SERVER_H_ | 5 #ifndef NET_TEST_LOCAL_TEST_SERVER_H_ |
6 #define NET_TEST_LOCAL_TEST_SERVER_H_ | 6 #define NET_TEST_LOCAL_TEST_SERVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/process.h" | 11 #include "base/process.h" |
(...skipping 26 matching lines...) Expand all Loading... | |
38 virtual ~LocalTestServer(); | 38 virtual ~LocalTestServer(); |
39 | 39 |
40 bool Start() WARN_UNUSED_RESULT; | 40 bool Start() WARN_UNUSED_RESULT; |
41 | 41 |
42 // Stop the server started by Start(). | 42 // Stop the server started by Start(). |
43 bool Stop(); | 43 bool Stop(); |
44 | 44 |
45 // Modify PYTHONPATH to contain libraries we need. | 45 // Modify PYTHONPATH to contain libraries we need. |
46 virtual bool SetPythonPath() const WARN_UNUSED_RESULT; | 46 virtual bool SetPythonPath() const WARN_UNUSED_RESULT; |
47 | 47 |
48 // This is a static version so that RunSyncTest in run_testserver.cc can use | 48 // Returns true if the FilePath for the directory of the testserver python |
49 // it. | 49 // script is successfully stored in |*directory|. |
50 // TODO(mattm): We should refactor so this isn't necessary (crbug.com/159731). | 50 virtual bool GetTestServerDirectory(FilePath* directory) const |
Paweł Hajdan Jr.
2013/01/17 23:38:49
Why not just let the callers extract the directory
Raghu Simha
2013/01/18 02:17:09
Agreed. I've removed GetTestServerDirectory. Done.
| |
51 static bool SetPythonPathStatic() WARN_UNUSED_RESULT; | 51 WARN_UNUSED_RESULT; |
52 | 52 |
53 // Returns true if successfully stored the FilePath for the directory of the | 53 // Returns true if the FilePath for the testserver python script is |
54 // testserver python script in |*directory|. | 54 // successfully stored in |*testserver_path|. |
55 static bool GetTestServerDirectory(FilePath* directory) WARN_UNUSED_RESULT; | |
56 | |
57 // Returns true if successfully stored the FilePath for the testserver python | |
58 // script in |*testserver_path|. | |
59 virtual bool GetTestServerPath(FilePath* testserver_path) const | 55 virtual bool GetTestServerPath(FilePath* testserver_path) const |
60 WARN_UNUSED_RESULT; | 56 WARN_UNUSED_RESULT; |
61 | 57 |
62 // Adds the command line arguments for the Python test server to | 58 // Adds the command line arguments for the Python test server to |
63 // |command_line|. Returns true on success. | 59 // |command_line|. Returns true on success. |
64 virtual bool AddCommandLineArguments(CommandLine* command_line) const | 60 virtual bool AddCommandLineArguments(CommandLine* command_line) const |
65 WARN_UNUSED_RESULT; | 61 WARN_UNUSED_RESULT; |
66 | 62 |
67 // Returns the actual path of document root for test cases. This function | 63 // Returns the actual path of document root for test cases. This function |
68 // should be called by test cases to retrieve the actual document root path. | 64 // should be called by test cases to retrieve the actual document root path. |
(...skipping 27 matching lines...) Expand all Loading... | |
96 int child_fd_; | 92 int child_fd_; |
97 file_util::ScopedFD child_fd_closer_; | 93 file_util::ScopedFD child_fd_closer_; |
98 #endif | 94 #endif |
99 | 95 |
100 DISALLOW_COPY_AND_ASSIGN(LocalTestServer); | 96 DISALLOW_COPY_AND_ASSIGN(LocalTestServer); |
101 }; | 97 }; |
102 | 98 |
103 } // namespace net | 99 } // namespace net |
104 | 100 |
105 #endif // NET_TEST_LOCAL_TEST_SERVER_H_ | 101 #endif // NET_TEST_LOCAL_TEST_SERVER_H_ |
OLD | NEW |