summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-15 21:44:51 +0000
committervitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-15 21:44:51 +0000
commit6f5c141a64e887b5219e46f136971871680fbec2 (patch)
treee00f8ca76ddbf346c8b32219402baa2383aa1f21
parent53794d00508ace09d4356c7bc56bfdf57a47edfe (diff)
downloadchromium_src-6f5c141a64e887b5219e46f136971871680fbec2.zip
chromium_src-6f5c141a64e887b5219e46f136971871680fbec2.tar.gz
chromium_src-6f5c141a64e887b5219e46f136971871680fbec2.tar.bz2
Added --cloud-print-xmpp-endpoint to make possible test with non-default XMPP server.
Review URL: https://codereview.chromium.org/231913004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264007 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chrome_content_browser_client.cc1
-rw-r--r--chrome/browser/service_process/service_process_control.cc1
-rw-r--r--chrome/common/chrome_switches.cc6
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/service/cloud_print/cloud_print_proxy_backend.cc3
-rw-r--r--cloud_print/service/win/service_utils.cc1
6 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index d0ed882..fd7a888 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1572,6 +1572,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kAppsCheckoutURL,
switches::kAppsGalleryURL,
switches::kCloudPrintServiceURL,
+ switches::kCloudPrintXmppEndpoint,
switches::kDisableBundledPpapiFlash,
switches::kDisableExtensionsResourceWhitelist,
switches::kDisablePnacl,
diff --git a/chrome/browser/service_process/service_process_control.cc b/chrome/browser/service_process/service_process_control.cc
index dbac06c..4cd3a3a2 100644
--- a/chrome/browser/service_process/service_process_control.cc
+++ b/chrome/browser/service_process/service_process_control.cc
@@ -137,6 +137,7 @@ void ServiceProcessControl::Launch(const base::Closure& success_task,
static const char* const kSwitchesToCopy[] = {
switches::kCloudPrintServiceURL,
switches::kCloudPrintSetupProxy,
+ switches::kCloudPrintXmppEndpoint,
#if defined(OS_WIN)
switches::kEnableCloudPrintXps,
#endif
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 2c56c35..60f3a87 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -175,9 +175,13 @@ const char kCloudPrintSetupProxy[] = "cloud-print-setup-proxy";
// The URL of the cloud print service to use, overrides any value stored in
// preferences, and the default. Only used if the cloud print service has been
-// enabled (see enable-cloud-print).
+// enabled. Used for testing.
const char kCloudPrintServiceURL[] = "cloud-print-service";
+// The XMPP endpoint the cloud print service will use. Only used if the cloud
+// print service has been enabled. Used for testing.
+const char kCloudPrintXmppEndpoint[] = "cloud-print-xmpp-endpoint";
+
// Comma-separated options to troubleshoot the component updater. Only valid
// for the browser process.
const char kComponentUpdater[] = "component-updater";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 358d597..5f438bb 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -63,6 +63,7 @@ extern const char kCloudPrintFileType[];
extern const char kCloudPrintPrintTicket[];
extern const char kCloudPrintSetupProxy[];
extern const char kCloudPrintServiceURL[];
+extern const char kCloudPrintXmppEndpoint[];
extern const char kComponentUpdater[];
extern const char kConflictingModulesCheck[];
extern const char kCrashOnHangThreads[];
diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.cc b/chrome/service/cloud_print/cloud_print_proxy_backend.cc
index 6423c51..de44436 100644
--- a/chrome/service/cloud_print/cloud_print_proxy_backend.cc
+++ b/chrome/service/cloud_print/cloud_print_proxy_backend.cc
@@ -341,6 +341,9 @@ void CloudPrintProxyBackend::Core::InitNotifications(
g_service_process->GetServiceURLRequestContextGetter();
notifier_options.auth_mechanism = "X-OAUTH2";
notifier_options.try_ssltcp_first = true;
+ notifier_options.xmpp_host_port = net::HostPortPair::FromString(
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kCloudPrintXmppEndpoint));
push_client_ = notifier::PushClient::CreateDefault(notifier_options);
push_client_->AddObserver(this);
notifier::Subscription subscription;
diff --git a/cloud_print/service/win/service_utils.cc b/cloud_print/service/win/service_utils.cc
index 37f2747..2d1d3a4 100644
--- a/cloud_print/service/win/service_utils.cc
+++ b/cloud_print/service/win/service_utils.cc
@@ -50,6 +50,7 @@ base::string16 GetCurrentUserName() {
void CopyChromeSwitchesFromCurrentProcess(CommandLine* destination) {
static const char* const kSwitchesToCopy[] = {
switches::kCloudPrintServiceURL,
+ switches::kCloudPrintXmppEndpoint,
switches::kEnableCloudPrintXps,
switches::kEnableLogging,
switches::kIgnoreUrlFetcherCertRequests,