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

Unified Diff: net/test/local_sync_test_server.cc

Issue 10388206: [sync] Add --port and --xmpp-port parameters to run_testserver.cc (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix compile with OVERRIDE Created 8 years, 7 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: net/test/local_sync_test_server.cc
diff --git a/net/test/local_sync_test_server.cc b/net/test/local_sync_test_server.cc
new file mode 100644
index 0000000000000000000000000000000000000000..64021b3592cfc9be80906927acedd4a58cb9b061
--- /dev/null
+++ b/net/test/local_sync_test_server.cc
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 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.
+
+#include "net/test/local_sync_test_server.h"
+
+#include "base/values.h"
+#include "net/test/test_server.h"
+
+namespace net {
+
+LocalSyncTestServer::LocalSyncTestServer()
+ : LocalTestServer(net::TestServer::TYPE_SYNC,
+ net::TestServer::kLocalhost,
+ FilePath()),
+ xmpp_port_(0) {}
+
+LocalSyncTestServer::LocalSyncTestServer(uint16 port, uint16 xmpp_port)
+ : LocalTestServer(net::TestServer::TYPE_SYNC,
+ net::TestServer::kLocalhost,
+ FilePath()),
+ xmpp_port_(xmpp_port) {
+ SetPort(port);
+}
+
+LocalSyncTestServer::~LocalSyncTestServer() {}
+
+bool LocalSyncTestServer::GenerateArguments(
+ base::DictionaryValue* arguments) const {
+ BaseTestServer::GenerateArguments(arguments);
+ if (xmpp_port_ != 0) {
+ arguments->SetInteger("xmpp-port", xmpp_port_);
+ }
+ return true;
+}
+
+void LocalSyncTestServer::CleanUpWhenStoppingServer() {
+ BaseTestServer::CleanUpWhenStoppingServer();
+ xmpp_port_ = 0;
+}
+
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698