Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2181)

Unified Diff: sync/test/local_sync_test_server.h

Issue 11971025: [sync] Divorce python sync test server chromiumsync.py from testserver.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Philippe's comments. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sync/test/local_sync_test_server.h
diff --git a/sync/test/local_sync_test_server.h b/sync/test/local_sync_test_server.h
new file mode 100644
index 0000000000000000000000000000000000000000..54547b8db4e0e5cc6044c4cb578b230a13f238cb
--- /dev/null
+++ b/sync/test/local_sync_test_server.h
@@ -0,0 +1,59 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYNC_TEST_LOCAL_SYNC_TEST_SERVER_H_
+#define SYNC_TEST_LOCAL_SYNC_TEST_SERVER_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "net/test/local_test_server.h"
+
+namespace syncer {
+
+// Runs a Python-based sync test server on the same machine on which the
+// LocalSyncTestServer runs.
+class LocalSyncTestServer : public net::LocalTestServer {
+ public:
+ // Initialize a sync server that listens on localhost using ephemeral ports
+ // for sync and p2p notifications.
+ LocalSyncTestServer();
+
+ // Initialize a sync server that listens on |port| for sync updates and
+ // |xmpp_port| for p2p notifications.
+ LocalSyncTestServer(uint16 port, uint16 xmpp_port);
Paweł Hajdan Jr. 2013/01/17 23:38:49 Is this ctor needed? Can it be removed (possibly i
Raghu Simha 2013/01/18 02:17:09 We do need this constructor. It is used in run_syn
+
+ virtual ~LocalSyncTestServer();
+
+ // Calls LocalTestServer::AddCommandLineArguments and then appends the
Paweł Hajdan Jr. 2013/01/17 23:38:49 nit: No need to put implementation details here.
Raghu Simha 2013/01/18 02:17:09 Done.
+ // --xmpp-port flag to |command_line| if required. Returns true on success.
+ virtual bool AddCommandLineArguments(
+ CommandLine* command_line) const OVERRIDE;
+
+ // Calls LocalTestServer::SetPythonPath and then modifies PYTHONPATH to
Paweł Hajdan Jr. 2013/01/17 23:38:49 nit: No need to put implementation details here.
Raghu Simha 2013/01/18 02:17:09 Done.
+ // contain libraries needed for the python sync server.
+ virtual bool SetPythonPath() const OVERRIDE;
+
+ // Returns true if the FilePath for the directory of the testserver python
Paweł Hajdan Jr. 2013/01/17 23:38:49 nit: No need to repeat comments from parent class
Raghu Simha 2013/01/18 02:17:09 Done.
+ // script is successfully stored in |*directory|.
+ virtual bool GetTestServerDirectory(FilePath* directory) const OVERRIDE;
+
+ // Returns true if the FilePath for the testserver python script is
+ // successfully stored in |*testserver_path|.
+ virtual bool GetTestServerPath(FilePath* testserver_path) const OVERRIDE;
+
+ // Returns true if the path to |test_script_name| is successfully stored in
+ // |*test_script_path|. Used by the run_sync_testserver executable.
+ bool GetTestScriptPath(const FilePath::StringType& test_script_name,
+ FilePath* test_script_path) const;
+
+ private:
+ // Port on which the Sync XMPP server listens.
+ uint16 xmpp_port_;
+
+ DISALLOW_COPY_AND_ASSIGN(LocalSyncTestServer);
+};
+
+} // namespace syncer
+
+#endif // SYNC_TEST_LOCAL_SYNC_TEST_SERVER_H_

Powered by Google App Engine
This is Rietveld 408576698