OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_REMOTE_TEST_SERVER_H_ | 5 #ifndef NET_TEST_REMOTE_TEST_SERVER_H_ |
6 #define NET_TEST_REMOTE_TEST_SERVER_H_ | 6 #define NET_TEST_REMOTE_TEST_SERVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "net/test/base_test_server.h" | 10 #include "net/test/base_test_server.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 const FilePath& document_root); | 24 const FilePath& document_root); |
25 | 25 |
26 // Initialize a TestServer with a specific set of SSLOptions. | 26 // Initialize a TestServer with a specific set of SSLOptions. |
27 // |document_root| must be a relative path under the root tree. | 27 // |document_root| must be a relative path under the root tree. |
28 RemoteTestServer(Type type, | 28 RemoteTestServer(Type type, |
29 const SSLOptions& ssl_options, | 29 const SSLOptions& ssl_options, |
30 const FilePath& document_root); | 30 const FilePath& document_root); |
31 | 31 |
32 virtual ~RemoteTestServer(); | 32 virtual ~RemoteTestServer(); |
33 | 33 |
34 // Starts the Python test server on the host, instead of on the device. | 34 // Starts the Python test server on the host, instead of on the device, and |
| 35 // blocks until the server is ready. |
35 bool Start() WARN_UNUSED_RESULT; | 36 bool Start() WARN_UNUSED_RESULT; |
36 | 37 |
| 38 // These are currently unused and unimplemented for RemoteTestServer. See |
| 39 // the same methods in LocalTestServer for more information. |
| 40 bool StartInBackground() WARN_UNUSED_RESULT; |
| 41 bool BlockUntilStarted() WARN_UNUSED_RESULT; |
| 42 |
37 // Stops the Python test server that is running on the host machine. | 43 // Stops the Python test server that is running on the host machine. |
38 bool Stop(); | 44 bool Stop(); |
39 | 45 |
40 // Returns the actual path of document root for the test cases. This function | 46 // Returns the actual path of document root for the test cases. This function |
41 // should be called by test cases to retrieve the actual document root path | 47 // should be called by test cases to retrieve the actual document root path |
42 // on the Android device, otherwise document_root() function is used to get | 48 // on the Android device, otherwise document_root() function is used to get |
43 // the document root. | 49 // the document root. |
44 FilePath GetDocumentRoot() const; | 50 FilePath GetDocumentRoot() const; |
45 | 51 |
46 private: | 52 private: |
47 bool Init(const FilePath& document_root); | 53 bool Init(const FilePath& document_root); |
48 | 54 |
49 // The local port used to communicate with the TestServer spawner. This is | 55 // The local port used to communicate with the TestServer spawner. This is |
50 // used to control the startup and shutdown of the Python TestServer running | 56 // used to control the startup and shutdown of the Python TestServer running |
51 // on the remote machine. On Android, this port will be redirected to the | 57 // on the remote machine. On Android, this port will be redirected to the |
52 // same port on the host machine. | 58 // same port on the host machine. |
53 int spawner_server_port_; | 59 int spawner_server_port_; |
54 | 60 |
55 // Helper to start and stop instances of the Python test server that runs on | 61 // Helper to start and stop instances of the Python test server that runs on |
56 // the host machine. | 62 // the host machine. |
57 scoped_ptr<SpawnerCommunicator> spawner_communicator_; | 63 scoped_ptr<SpawnerCommunicator> spawner_communicator_; |
58 | 64 |
59 DISALLOW_COPY_AND_ASSIGN(RemoteTestServer); | 65 DISALLOW_COPY_AND_ASSIGN(RemoteTestServer); |
60 }; | 66 }; |
61 | 67 |
62 } // namespace net | 68 } // namespace net |
63 | 69 |
64 #endif // NET_TEST_REMOTE_TEST_SERVER_H_ | 70 #endif // NET_TEST_REMOTE_TEST_SERVER_H_ |
65 | 71 |
OLD | NEW |