| OLD | NEW |
| 1 // Copyright 2013 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_SPAWNED_TEST_SERVER_LOCAL_TEST_SERVER_H_ | 5 #ifndef NET_TEST_SPAWNED_TEST_SERVER_LOCAL_TEST_SERVER_H_ |
| 6 #define NET_TEST_SPAWNED_TEST_SERVER_LOCAL_TEST_SERVER_H_ | 6 #define NET_TEST_SPAWNED_TEST_SERVER_LOCAL_TEST_SERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 LocalTestServer(Type type, | 31 LocalTestServer(Type type, |
| 32 const std::string& host, | 32 const std::string& host, |
| 33 const base::FilePath& document_root); | 33 const base::FilePath& document_root); |
| 34 | 34 |
| 35 // Initialize a TestServer with a specific set of SSLOptions. | 35 // Initialize a TestServer with a specific set of SSLOptions. |
| 36 // |document_root| must be a relative path under the root tree. | 36 // |document_root| must be a relative path under the root tree. |
| 37 LocalTestServer(Type type, | 37 LocalTestServer(Type type, |
| 38 const SSLOptions& ssl_options, | 38 const SSLOptions& ssl_options, |
| 39 const base::FilePath& document_root); | 39 const base::FilePath& document_root); |
| 40 | 40 |
| 41 virtual ~LocalTestServer(); | 41 ~LocalTestServer() override; |
| 42 | 42 |
| 43 // Start the test server and block until it's ready. Returns true on success. | 43 // Start the test server and block until it's ready. Returns true on success. |
| 44 bool Start() WARN_UNUSED_RESULT; | 44 bool Start() WARN_UNUSED_RESULT; |
| 45 | 45 |
| 46 // Start the test server without blocking. Use this if you need multiple test | 46 // Start the test server without blocking. Use this if you need multiple test |
| 47 // servers (such as WebSockets and HTTP, or HTTP and HTTPS). You must call | 47 // servers (such as WebSockets and HTTP, or HTTP and HTTPS). You must call |
| 48 // BlockUntilStarted on all servers your test requires before executing the | 48 // BlockUntilStarted on all servers your test requires before executing the |
| 49 // test. For example: | 49 // test. For example: |
| 50 // | 50 // |
| 51 // // Start the servers in parallel. | 51 // // Start the servers in parallel. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // The file descriptor the child writes to when it starts. | 107 // The file descriptor the child writes to when it starts. |
| 108 base::ScopedFD child_fd_; | 108 base::ScopedFD child_fd_; |
| 109 #endif | 109 #endif |
| 110 | 110 |
| 111 DISALLOW_COPY_AND_ASSIGN(LocalTestServer); | 111 DISALLOW_COPY_AND_ASSIGN(LocalTestServer); |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 } // namespace net | 114 } // namespace net |
| 115 | 115 |
| 116 #endif // NET_TEST_SPAWNED_TEST_SERVER_LOCAL_TEST_SERVER_H_ | 116 #endif // NET_TEST_SPAWNED_TEST_SERVER_LOCAL_TEST_SERVER_H_ |
| OLD | NEW |