[Telemetry] Remove unit-info.json from tools/perf
[chromium-blink-merge.git] / sync / test / local_sync_test_server.h
blob4c3c01f82c202fd9a25d46f6adff03f0705ae2a0
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
3 // found in the LICENSE file.
5 #ifndef SYNC_TEST_LOCAL_SYNC_TEST_SERVER_H_
6 #define SYNC_TEST_LOCAL_SYNC_TEST_SERVER_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "net/test/spawned_test_server/local_test_server.h"
12 namespace syncer {
14 // Runs a Python-based sync test server on the same machine on which the
15 // LocalSyncTestServer runs.
16 class LocalSyncTestServer : public net::LocalTestServer {
17 public:
18 // Initialize a sync server that listens on localhost using ephemeral ports
19 // for sync and p2p notifications.
20 LocalSyncTestServer();
22 // Initialize a sync server that listens on |port| for sync updates and
23 // |xmpp_port| for p2p notifications.
24 LocalSyncTestServer(uint16 port, uint16 xmpp_port);
26 ~LocalSyncTestServer() override;
28 // Overriden from net::LocalTestServer.
29 bool AddCommandLineArguments(base::CommandLine* command_line) const override;
30 bool SetPythonPath() const override;
31 bool GetTestServerPath(base::FilePath* testserver_path) const override;
33 // Returns true if the path to |test_script_name| is successfully stored in
34 // |*test_script_path|. Used by the run_sync_testserver executable.
35 bool GetTestScriptPath(const base::FilePath::StringType& test_script_name,
36 base::FilePath* test_script_path) const;
38 private:
39 // Port on which the Sync XMPP server listens.
40 uint16 xmpp_port_;
42 DISALLOW_COPY_AND_ASSIGN(LocalSyncTestServer);
45 } // namespace syncer
47 #endif // SYNC_TEST_LOCAL_SYNC_TEST_SERVER_H_