summaryrefslogtreecommitdiff
path: root/chromium/net/test/spawned_test_server/remote_test_server.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/test/spawned_test_server/remote_test_server.h')
-rw-r--r--chromium/net/test/spawned_test_server/remote_test_server.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/chromium/net/test/spawned_test_server/remote_test_server.h b/chromium/net/test/spawned_test_server/remote_test_server.h
index 4fb3396c237..ca6588923dd 100644
--- a/chromium/net/test/spawned_test_server/remote_test_server.h
+++ b/chromium/net/test/spawned_test_server/remote_test_server.h
@@ -10,12 +10,10 @@
#include "base/macros.h"
#include "base/threading/thread.h"
#include "net/test/spawned_test_server/base_test_server.h"
-#include "net/test/spawned_test_server/remote_test_server_config.h"
namespace net {
class RemoteTestServerSpawnerRequest;
-class TcpSocketProxy;
// The RemoteTestServer runs an external Python-based test server in another
// machine that is different from the machine that executes the tests. It is
@@ -31,6 +29,19 @@ class TcpSocketProxy;
// this spawner communicator. The spawner is implemented in
// build/util/lib/common/chrome_test_server_spawner.py .
//
+// URL for the spawner server is discovered by reading config file that's
+// expected to be written on the test device by the test scrips. Location of the
+// config dependends on platform:
+// - Android: DIR_ANDROID_EXTERNAL_STORAGE/net-test-server-config
+// - other: DIR_TEMP/net-test-server-config
+//
+// The config file must be stored in the following format:
+// {
+// 'spawner_url_base': 'http://localhost:5000'
+// }
+//
+// 'spawner_url_base' specifies base URL for the spawner.
+//
// Currently the following two commands are supported by spawner.
//
// (1) Start Python test server, format is:
@@ -81,10 +92,15 @@ class RemoteTestServer : public BaseTestServer {
private:
bool Init(const base::FilePath& document_root);
- RemoteTestServerConfig config_;
+ // Returns URL for the specified spawner |command|.
+ GURL GetSpawnerUrl(const std::string& command) const;
+
+ // URL of the test server spawner. Read from the config file during
+ // initialization.
+ std::string spawner_url_base_;
// Thread used to run all IO activity in RemoteTestServerSpawnerRequest and
- // |test_server_proxy_|.
+ // |ocsp_proxy_|.
base::Thread io_thread_;
std::unique_ptr<RemoteTestServerSpawnerRequest> start_request_;
@@ -92,9 +108,6 @@ class RemoteTestServer : public BaseTestServer {
// Server port. Non-zero when the server is running.
int remote_port_ = 0;
- std::unique_ptr<TcpSocketProxy> test_server_proxy_;
- std::unique_ptr<TcpSocketProxy> ocsp_proxy_;
-
DISALLOW_COPY_AND_ASSIGN(RemoteTestServer);
};