| 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 testserver python script is |
| 49 // it. | 49 // successfully stored in |*testserver_path|. |
| 50 // TODO(mattm): We should refactor so this isn't necessary (crbug.com/159731). | |
| 51 static bool SetPythonPathStatic() WARN_UNUSED_RESULT; | |
| 52 | |
| 53 // Returns true if successfully stored the FilePath for the directory of the | |
| 54 // testserver python script in |*directory|. | |
| 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 | 50 virtual bool GetTestServerPath(FilePath* testserver_path) const |
| 60 WARN_UNUSED_RESULT; | 51 WARN_UNUSED_RESULT; |
| 61 | 52 |
| 62 // Adds the command line arguments for the Python test server to | 53 // Adds the command line arguments for the Python test server to |
| 63 // |command_line|. Returns true on success. | 54 // |command_line|. Returns true on success. |
| 64 virtual bool AddCommandLineArguments(CommandLine* command_line) const | 55 virtual bool AddCommandLineArguments(CommandLine* command_line) const |
| 65 WARN_UNUSED_RESULT; | 56 WARN_UNUSED_RESULT; |
| 66 | 57 |
| 67 // Returns the actual path of document root for test cases. This function | 58 // 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. | 59 // should be called by test cases to retrieve the actual document root path. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 96 int child_fd_; | 87 int child_fd_; |
| 97 file_util::ScopedFD child_fd_closer_; | 88 file_util::ScopedFD child_fd_closer_; |
| 98 #endif | 89 #endif |
| 99 | 90 |
| 100 DISALLOW_COPY_AND_ASSIGN(LocalTestServer); | 91 DISALLOW_COPY_AND_ASSIGN(LocalTestServer); |
| 101 }; | 92 }; |
| 102 | 93 |
| 103 } // namespace net | 94 } // namespace net |
| 104 | 95 |
| 105 #endif // NET_TEST_LOCAL_TEST_SERVER_H_ | 96 #endif // NET_TEST_LOCAL_TEST_SERVER_H_ |
| OLD | NEW |