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; |
} |