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

Unified Diff: chrome/test/live_sync/live_sync_test.cc

Issue 5239001: [Sync] Make sync integration tests use local xmpp servers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « no previous file | jingle/notifier/communicator/connection_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/live_sync/live_sync_test.cc
diff --git a/chrome/test/live_sync/live_sync_test.cc b/chrome/test/live_sync/live_sync_test.cc
index 7b4ac354cd7be61c869c0946744446561e1c1d86..e9b26dcfe0b473ee2a0f8320628e774dd8f1e831 100644
--- a/chrome/test/live_sync/live_sync_test.cc
+++ b/chrome/test/live_sync/live_sync_test.cc
@@ -6,6 +6,7 @@
#include <vector>
+#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/message_loop.h"
@@ -14,6 +15,7 @@
#include "base/string_util.h"
#include "base/task.h"
#include "base/test/test_timeouts.h"
+#include "base/values.h"
#include "base/waitable_event.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/password_manager/encryptor.h"
@@ -332,8 +334,25 @@ bool LiveSyncTest::SetUpLocalPythonTestServer() {
cl->AppendSwitchASCII(switches::kSyncServiceURL, sync_service_url);
VLOG(1) << "Started local python test server at " << sync_service_url;
- // TODO(akalin): Set the kSyncNotificationHost switch here once a local python
- // notification server is implemented.
+ int xmpp_port = 0;
+ if (!sync_server_.server_data().GetInteger("xmpp_port", &xmpp_port)) {
+ LOG(ERROR) << "Could not find valid xmpp_port value";
+ return false;
+ }
+ if ((xmpp_port <= 0) || (xmpp_port >= kuint16max)) {
cbentzel 2010/11/19 15:46:25 This is in two locations now - should you have an
+ LOG(ERROR) << "Invalid xmpp port: " << xmpp_port;
+ return false;
+ }
+
+ net::HostPortPair xmpp_host_port_pair(sync_server_.host_port_pair());
+ xmpp_host_port_pair.set_port(xmpp_port);
+
+ if (!cl->HasSwitch(switches::kSyncNotificationHost)) {
+ cl->AppendSwitchASCII(switches::kSyncNotificationHost,
+ xmpp_host_port_pair.ToString());
+ // The local XMPP server only supports insecure connections.
+ cl->AppendSwitch(switches::kSyncAllowInsecureXmppConnection);
+ }
return true;
}
« no previous file with comments | « no previous file | jingle/notifier/communicator/connection_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698