summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-26 17:28:21 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-26 17:28:21 +0000
commite3688a2a3262b633d08837e336a0c41f28c72f37 (patch)
treea15bb77432383bd8b7631efa8bafa5abe67d0f02 /chrome
parente3f589a8ff35b87a387f17bf002cb81041c45a43 (diff)
downloadchromium_src-e3688a2a3262b633d08837e336a0c41f28c72f37.zip
chromium_src-e3688a2a3262b633d08837e336a0c41f28c72f37.tar.gz
chromium_src-e3688a2a3262b633d08837e336a0c41f28c72f37.tar.bz2
[Sync] Added some switches for testing/debugging.
Added back in --sync-invalidate-xmpp-login (now, not only in debug mode!). Added --sync-allow-insecure-xmpp-connection, which enables sync to connect to insecure XMPP servers (e.g., a local one). Changed --use-ssl-tcp to --sync-try-ssltcp-first-for-xmpp. BUG=None TEST=Manual Review URL: http://codereview.chromium.org/4158001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63903 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/sync/engine/syncapi.cc9
-rw-r--r--chrome/browser/sync/profile_sync_service.cc14
-rw-r--r--chrome/common/chrome_switches.cc11
-rw-r--r--chrome/common/chrome_switches.h4
-rw-r--r--chrome/service/cloud_print/cloud_print_proxy_backend.cc4
-rw-r--r--chrome/test/live_sync/live_sync_test.cc4
6 files changed, 37 insertions, 9 deletions
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index 7bc7e7e..8c3b856 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -1554,11 +1554,16 @@ void SyncManager::SyncInternal::InitializeTalkMediator() {
new sync_notifier::ServerNotifierThread(
notifier_options_, state, this);
talk_mediator_.reset(
- new TalkMediatorImpl(server_notifier_thread, false));
+ new TalkMediatorImpl(server_notifier_thread,
+ notifier_options_.invalidate_xmpp_login,
+ notifier_options_.allow_insecure_connection));
} else {
notifier::MediatorThread* mediator_thread =
new notifier::MediatorThreadImpl(notifier_options_);
- talk_mediator_.reset(new TalkMediatorImpl(mediator_thread, false));
+ talk_mediator_.reset(
+ new TalkMediatorImpl(mediator_thread,
+ notifier_options_.invalidate_xmpp_login,
+ notifier_options_.allow_insecure_connection));
if (notifier_options_.notification_method !=
notifier::NOTIFICATION_LEGACY) {
if (notifier_options_.notification_method ==
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index f8a7e57..9a6ea99 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -280,10 +280,22 @@ void ProfileSyncService::InitSettings() {
}
notifier_options_.try_ssltcp_first =
- command_line.HasSwitch(switches::kSyncUseSslTcp);
+ command_line.HasSwitch(switches::kSyncTrySsltcpFirstForXmpp);
if (notifier_options_.try_ssltcp_first)
VLOG(1) << "Trying SSL/TCP port before XMPP port for notifications.";
+ notifier_options_.invalidate_xmpp_login =
+ command_line.HasSwitch(switches::kSyncInvalidateXmppLogin);
+ if (notifier_options_.invalidate_xmpp_login) {
+ VLOG(1) << "Invalidating sync XMPP login.";
+ }
+
+ notifier_options_.allow_insecure_connection =
+ command_line.HasSwitch(switches::kSyncAllowInsecureXmppConnection);
+ if (notifier_options_.allow_insecure_connection) {
+ VLOG(1) << "Allowing insecure XMPP connections.";
+ }
+
if (command_line.HasSwitch(switches::kSyncNotificationMethod)) {
const std::string notification_method_str(
command_line.GetSwitchValueASCII(switches::kSyncNotificationMethod));
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 1c9b9d7..9b891e0 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -980,6 +980,13 @@ const char kSingleProcess[] = "single-process";
// Start the browser maximized, regardless of any previous settings.
const char kStartMaximized[] = "start-maximized";
+// Allow insecure XMPP connections for sync (for testing).
+const char kSyncAllowInsecureXmppConnection[] =
+ "sync-allow-insecure-xmpp-connection";
+
+// Invalidate any login info passed into sync's XMPP connection.
+const char kSyncInvalidateXmppLogin[] = "sync-invalidate-xmpp-login";
+
// Use the SyncerThread implementation that matches up with the old pthread
// impl semantics, but using Chrome synchronization primitives. The only
// difference between this and the default is that we now have no timeout on
@@ -995,8 +1002,8 @@ const char kSyncNotificationHost[] = "sync-notification-host";
// Override the default server used for profile sync.
const char kSyncServiceURL[] = "sync-url";
-// Control Sync XMPP client settings.
-const char kSyncUseSslTcp[] = "use-ssl-tcp";
+// Try to connect to XMPP using SSLTCP first (for testing).
+const char kSyncTrySsltcpFirstForXmpp[] = "sync-try-ssltcp-first-for-xmpp";
// Pass the name of the current running automated test to Chrome.
const char kTestName[] = "test-name";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 3676599..62995a2 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -275,11 +275,13 @@ extern const char kSilentDumpOnDCHECK[];
extern const char kSimpleDataSource[];
extern const char kSingleProcess[];
extern const char kStartMaximized[];
+extern const char kSyncAllowInsecureXmppConnection[];
+extern const char kSyncInvalidateXmppLogin[];
extern const char kSyncerThreadTimedStop[];
extern const char kSyncNotificationMethod[];
extern const char kSyncNotificationHost[];
extern const char kSyncServiceURL[];
-extern const char kSyncUseSslTcp[];
+extern const char kSyncTrySsltcpFirstForXmpp[];
extern const char kTestNaClSandbox[];
extern const char kTestName[];
extern const char kTestSandbox[];
diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.cc b/chrome/service/cloud_print/cloud_print_proxy_backend.cc
index ac4e110..38fa3d4 100644
--- a/chrome/service/cloud_print/cloud_print_proxy_backend.cc
+++ b/chrome/service/cloud_print/cloud_print_proxy_backend.cc
@@ -323,10 +323,12 @@ void CloudPrintProxyBackend::Core::DoInitializeWithToken(
const notifier::NotifierOptions kNotifierOptions;
const bool kInvalidateXmppAuthToken = false;
+ const bool kAllowInsecureXmppConnection = false;
talk_mediator_.reset(new notifier::TalkMediatorImpl(
new notifier::PushNotificationsThread(kNotifierOptions,
kCloudPrintPushNotificationsSource),
- kInvalidateXmppAuthToken));
+ kInvalidateXmppAuthToken,
+ kAllowInsecureXmppConnection));
push_notifications_channel_ = kCloudPrintPushNotificationsSource;
push_notifications_channel_.append("/proxy/");
push_notifications_channel_.append(proxy_id);
diff --git a/chrome/test/live_sync/live_sync_test.cc b/chrome/test/live_sync/live_sync_test.cc
index f73c2d1..07a94d4 100644
--- a/chrome/test/live_sync/live_sync_test.cc
+++ b/chrome/test/live_sync/live_sync_test.cc
@@ -114,8 +114,8 @@ void LiveSyncTest::SetUp() {
// minute waiting for a connection on port 5222 before they fail over to port
// 443, the default SSL/TCP port. This switch causes the tests to use port 443
// by default, without having to try port 5222.
- if (!cl->HasSwitch(switches::kSyncUseSslTcp)) {
- cl->AppendSwitch(switches::kSyncUseSslTcp);
+ if (!cl->HasSwitch(switches::kSyncTrySsltcpFirstForXmpp)) {
+ cl->AppendSwitch(switches::kSyncTrySsltcpFirstForXmpp);
}
// Mock the Mac Keychain service. The real Keychain can block on user input.