diff options
author | gene@chromium.org <gene@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-26 08:48:24 +0000 |
---|---|---|
committer | gene@chromium.org <gene@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-26 08:48:24 +0000 |
commit | 0c27b1ba7c313e5211f7a8aa08b2835142df27fd (patch) | |
tree | b711699853251ecc4358a14897b050117a7a08b7 /chrome/service | |
parent | ee1de13434e991ab4ff923d7cccf64e33b01ba5c (diff) | |
download | chromium_src-0c27b1ba7c313e5211f7a8aa08b2835142df27fd.zip chromium_src-0c27b1ba7c313e5211f7a8aa08b2835142df27fd.tar.gz chromium_src-0c27b1ba7c313e5211f7a8aa08b2835142df27fd.tar.bz2 |
Cloud Print connector is now using local_settings field from GCP 2.0. "current" section contain current ping timeout from the connector. "pending" section will contain a proposed change from the server side. Connector will look up any new params in the "pending" section and store and use this value. If there is nothing in the pending section, current value from the config file will be used.
(This logic can be revisited once we re-write connector)
Clean up ticket validation error message.
BUG=297393
Review URL: https://codereview.chromium.org/24392003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225403 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service')
15 files changed, 162 insertions, 26 deletions
diff --git a/chrome/service/cloud_print/cloud_print_connector.cc b/chrome/service/cloud_print/cloud_print_connector.cc index 75cfe70..27372cf 100644 --- a/chrome/service/cloud_print/cloud_print_connector.cc +++ b/chrome/service/cloud_print/cloud_print_connector.cc @@ -124,6 +124,17 @@ void CloudPrintConnector::CheckForJobs(const std::string& reason, } } +void CloudPrintConnector::UpdatePrinterSettings(const std::string& printer_id) { + // Since connector is managing many printers we need to go through all of them + // to select the correct settings. + GURL printer_list_url = GetUrlForPrinterList( + settings_.server_url(), settings_.proxy_id()); + StartGetRequest( + printer_list_url, + kCloudPrintRegisterMaxRetryCount, + &CloudPrintConnector::HandlePrinterListResponseSettingsUpdate); +} + void CloudPrintConnector::OnPrinterAdded() { AddPendingAvailableTask(); } @@ -182,6 +193,8 @@ CloudPrintConnector::HandlePrinterListResponse( if (!succeeded) return CloudPrintURLFetcher::RETRY_REQUEST; + UpdateSettingsFromPrintersList(json_data); + // Now we need to get the list of printers from the print system // and split printers into 3 categories: // - existing and registered printers @@ -252,6 +265,20 @@ CloudPrintConnector::HandlePrinterListResponse( } CloudPrintURLFetcher::ResponseAction +CloudPrintConnector::HandlePrinterListResponseSettingsUpdate( + const net::URLFetcher* source, + const GURL& url, + DictionaryValue* json_data, + bool succeeded) { + DCHECK(succeeded); + if (!succeeded) + return CloudPrintURLFetcher::RETRY_REQUEST; + + UpdateSettingsFromPrintersList(json_data); + return CloudPrintURLFetcher::STOP_PROCESSING; +} + +CloudPrintURLFetcher::ResponseAction CloudPrintConnector::HandlePrinterDeleteResponse( const net::URLFetcher* source, const GURL& url, @@ -376,6 +403,12 @@ void CloudPrintConnector::InitJobHandlerForPrinter( } } } + + int xmpp_timeout = 0; + printer_data->GetInteger(kLocalSettingsPendingXmppValue, &xmpp_timeout); + printer_info_cloud.current_xmpp_timeout = settings_.xmpp_ping_timeout_sec(); + printer_info_cloud.pending_xmpp_timeout = xmpp_timeout; + scoped_refptr<PrinterJobHandler> job_handler; job_handler = new PrinterJobHandler(printer_info, printer_info_cloud, @@ -386,6 +419,32 @@ void CloudPrintConnector::InitJobHandlerForPrinter( job_handler->Initialize(); } +void CloudPrintConnector::UpdateSettingsFromPrintersList( + DictionaryValue* json_data) { + ListValue* printer_list = NULL; + int min_xmpp_timeout = std::numeric_limits<int>::max(); + // There may be no "printers" value in the JSON + if (json_data->GetList(kPrinterListValue, &printer_list) && printer_list) { + for (size_t index = 0; index < printer_list->GetSize(); index++) { + DictionaryValue* printer_data = NULL; + if (printer_list->GetDictionary(index, &printer_data)) { + int xmpp_timeout = 0; + if (printer_data->GetInteger(kLocalSettingsPendingXmppValue, + &xmpp_timeout)) { + min_xmpp_timeout = std::min(xmpp_timeout, min_xmpp_timeout); + } + } + } + } + + if (min_xmpp_timeout != std::numeric_limits<int>::max()) { + DCHECK(min_xmpp_timeout >= kMinXmppPingTimeoutSecs); + settings_.SetXmppPingTimeoutSec(min_xmpp_timeout); + client_->OnXmppPingUpdated(min_xmpp_timeout); + } +} + + void CloudPrintConnector::AddPendingAvailableTask() { PendingTask task; task.type = PENDING_PRINTERS_AVAILABLE; @@ -536,6 +595,11 @@ void CloudPrintConnector::OnReceivePrinterCaps( net::AddMultipartValueForUpload(kPrinterStatusValue, base::StringPrintf("%d", info.printer_status), mime_boundary, std::string(), &post_data); + // Add local_settings with a current XMPP ping interval. + net::AddMultipartValueForUpload(kPrinterLocalSettingsValue, + base::StringPrintf(kCreateLocalSettingsXmppPingFormat, + settings_.xmpp_ping_timeout_sec()), + mime_boundary, std::string(), &post_data); post_data += GetPostDataForPrinterInfo(info, mime_boundary); net::AddMultipartValueForUpload(kPrinterCapsValue, caps_and_defaults.printer_capabilities, mime_boundary, diff --git a/chrome/service/cloud_print/cloud_print_connector.h b/chrome/service/cloud_print/cloud_print_connector.h index 9e6c690..1cf1bd7 100644 --- a/chrome/service/cloud_print/cloud_print_connector.h +++ b/chrome/service/cloud_print/cloud_print_connector.h @@ -33,6 +33,7 @@ class CloudPrintConnector class Client { public: virtual void OnAuthFailed() = 0; + virtual void OnXmppPingUpdated(int ping_timeout) = 0; protected: virtual ~Client() {} }; @@ -50,6 +51,9 @@ class CloudPrintConnector // jobs will be checked for all available printers. void CheckForJobs(const std::string& reason, const std::string& printer_id); + // Update settings for specific printer. + void UpdatePrinterSettings(const std::string& printer_id); + private: friend class base::RefCountedThreadSafe<CloudPrintConnector>; @@ -106,6 +110,12 @@ class CloudPrintConnector DictionaryValue* json_data, bool succeeded); + CloudPrintURLFetcher::ResponseAction HandlePrinterListResponseSettingsUpdate( + const net::URLFetcher* source, + const GURL& url, + DictionaryValue* json_data, + bool succeeded); + CloudPrintURLFetcher::ResponseAction HandlePrinterDeleteResponse( const net::URLFetcher* source, const GURL& url, @@ -138,6 +148,8 @@ class CloudPrintConnector void InitJobHandlerForPrinter(DictionaryValue* printer_data); + void UpdateSettingsFromPrintersList(DictionaryValue* json_data); + void AddPendingAvailableTask(); void AddPendingDeleteTask(const std::string& id); void AddPendingRegisterTask(const printing::PrinterBasicInfo& info); diff --git a/chrome/service/cloud_print/cloud_print_helpers.cc b/chrome/service/cloud_print/cloud_print_helpers.cc index 716c17e..8479c16 100644 --- a/chrome/service/cloud_print/cloud_print_helpers.cc +++ b/chrome/service/cloud_print/cloud_print_helpers.cc @@ -32,16 +32,18 @@ std::string StringFromJobStatus(cloud_print::PrintJobStatus status) { return ret; } -} +} // namespace namespace cloud_print { GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url, const std::string& job_id, - PrintJobStatus status) { + PrintJobStatus status, + int connector_code) { return GetUrlForJobStatusUpdate(cloud_print_server_url, job_id, - StringFromJobStatus(status)); + StringFromJobStatus(status), + connector_code); } GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url, diff --git a/chrome/service/cloud_print/cloud_print_helpers.h b/chrome/service/cloud_print/cloud_print_helpers.h index a180d2a..7bfaddb 100644 --- a/chrome/service/cloud_print/cloud_print_helpers.h +++ b/chrome/service/cloud_print/cloud_print_helpers.h @@ -16,7 +16,8 @@ namespace cloud_print { // Helper methods for the cloud print proxy code. GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url, const std::string& job_id, - PrintJobStatus status); + PrintJobStatus status, + int connector_code); GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url, const std::string& job_id, diff --git a/chrome/service/cloud_print/cloud_print_helpers_unittest.cc b/chrome/service/cloud_print/cloud_print_helpers_unittest.cc index baa8903..258e40b 100644 --- a/chrome/service/cloud_print/cloud_print_helpers_unittest.cc +++ b/chrome/service/cloud_print/cloud_print_helpers_unittest.cc @@ -19,10 +19,11 @@ void CheckJobStatusURLs(const GURL& server_base_url) { if (expected_url_base[expected_url_base.length() - 1] != '/') expected_url_base += "/"; - EXPECT_EQ(base::StringPrintf("%scontrol?jobid=87654321&status=ERROR", + EXPECT_EQ(base::StringPrintf( + "%scontrol?jobid=87654321&status=ERROR&connector_code=1", expected_url_base.c_str()), GetUrlForJobStatusUpdate(server_base_url, "87654321", - PRINT_JOB_STATUS_ERROR).spec()); + PRINT_JOB_STATUS_ERROR, 1).spec()); PrintJobDetails details; details.status = PRINT_JOB_STATUS_IN_PROGRESS; diff --git a/chrome/service/cloud_print/cloud_print_proxy.cc b/chrome/service/cloud_print/cloud_print_proxy.cc index 24af3dc..eb22186 100644 --- a/chrome/service/cloud_print/cloud_print_proxy.cc +++ b/chrome/service/cloud_print/cloud_print_proxy.cc @@ -254,6 +254,12 @@ void CloudPrintProxy::OnUnregisterPrinters( wipeout_->UnregisterPrinters(auth_token, printer_ids); } +void CloudPrintProxy::OnXmppPingUpdated(int ping_timeout) { + DCHECK(CalledOnValidThread()); + service_prefs_->SetInt(prefs::kCloudPrintXmppPingTimeout, ping_timeout); + service_prefs_->WritePrefs(); +} + void CloudPrintProxy::OnUnregisterPrintersComplete() { wipeout_.reset(); // Finish disabling cloud print for this user. diff --git a/chrome/service/cloud_print/cloud_print_proxy.h b/chrome/service/cloud_print/cloud_print_proxy.h index 507eb9e..71c2d66 100644 --- a/chrome/service/cloud_print/cloud_print_proxy.h +++ b/chrome/service/cloud_print/cloud_print_proxy.h @@ -68,6 +68,7 @@ class CloudPrintProxy : public CloudPrintProxyFrontend, virtual void OnUnregisterPrinters( const std::string& auth_token, const std::list<std::string>& printer_ids) OVERRIDE; + virtual void OnXmppPingUpdated(int ping_timeout) OVERRIDE; // CloudPrintWipeout::Client implementation. virtual void OnUnregisterPrintersComplete() OVERRIDE; diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.cc b/chrome/service/cloud_print/cloud_print_proxy_backend.cc index 0125d71..db8a4d9 100644 --- a/chrome/service/cloud_print/cloud_print_proxy_backend.cc +++ b/chrome/service/cloud_print/cloud_print_proxy_backend.cc @@ -74,6 +74,7 @@ class CloudPrintProxyBackend::Core // CloudPrintConnector::Client implementation. virtual void OnAuthFailed() OVERRIDE; + virtual void OnXmppPingUpdated(int ping_timeout) OVERRIDE; // notifier::PushClientObserver implementation. virtual void OnNotificationsEnabled() OVERRIDE; @@ -103,12 +104,13 @@ class CloudPrintProxyBackend::Core void NotifyPrintSystemUnavailable(); void NotifyUnregisterPrinters(const std::string& auth_token, const std::list<std::string>& printer_ids); + void NotifyXmppPingUpdated(int ping_timeout); // Init XMPP channel void InitNotifications(const std::string& robot_email, const std::string& access_token); - void HandlePrinterNotification(const std::string& printer_id); + void HandlePrinterNotification(const std::string& notification); void PollForJobs(); // Schedules a task to poll for jobs. Does nothing if a task is already // scheduled. @@ -320,6 +322,13 @@ void CloudPrintProxyBackend::Core::OnAuthFailed() { auth_->RefreshAccessToken(); } +void CloudPrintProxyBackend::Core::OnXmppPingUpdated(int ping_timeout) { + settings_.SetXmppPingTimeoutSec(ping_timeout); + backend_->frontend_loop_->PostTask( + FROM_HERE, + base::Bind(&Core::NotifyXmppPingUpdated, this, ping_timeout)); +} + void CloudPrintProxyBackend::Core::InitNotifications( const std::string& robot_email, const std::string& access_token) { @@ -375,10 +384,20 @@ void CloudPrintProxyBackend::Core::DoUnregisterPrinters() { } void CloudPrintProxyBackend::Core::HandlePrinterNotification( - const std::string& printer_id) { + const std::string& notification) { DCHECK(base::MessageLoop::current() == backend_->core_thread_.message_loop()); - VLOG(1) << "CP_CONNECTOR: Handle printer notification, id: " << printer_id; - connector_->CheckForJobs(kJobFetchReasonNotified, printer_id); + + size_t pos = notification.rfind(kNotificationUpdateSettings); + if (pos == std::string::npos) { + VLOG(1) << "CP_CONNECTOR: Handle printer notification, id: " + << notification; + connector_->CheckForJobs(kJobFetchReasonNotified, notification); + } else { + DCHECK(pos == notification.length() - strlen(kNotificationUpdateSettings)); + std::string printer_id = notification.substr(0, pos); + VLOG(1) << "CP_CONNECTOR: Update printer settings, id: " << printer_id; + connector_->UpdatePrinterSettings(printer_id); + } } void CloudPrintProxyBackend::Core::PollForJobs() { @@ -429,9 +448,8 @@ void CloudPrintProxyBackend::Core::PingXmppServer() { } void CloudPrintProxyBackend::Core::ScheduleXmppPing() { - if (!settings_.xmpp_ping_enabled()) - return; - + // settings_.xmpp_ping_enabled() is obsolete, we are now control + // XMPP pings from Cloud Print server. if (!xmpp_ping_scheduled_) { base::TimeDelta interval = base::TimeDelta::FromSeconds( base::RandInt(settings_.xmpp_ping_timeout_sec() * 0.9, @@ -486,6 +504,11 @@ void CloudPrintProxyBackend::Core::NotifyUnregisterPrinters( backend_->frontend_->OnUnregisterPrinters(auth_token, printer_ids); } +void CloudPrintProxyBackend::Core::NotifyXmppPingUpdated(int ping_timeout) { + DCHECK(base::MessageLoop::current() == backend_->frontend_loop_); + backend_->frontend_->OnXmppPingUpdated(ping_timeout); +} + void CloudPrintProxyBackend::Core::OnNotificationsEnabled() { DCHECK(base::MessageLoop::current() == backend_->core_thread_.message_loop()); notifications_enabled_ = true; diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.h b/chrome/service/cloud_print/cloud_print_proxy_backend.h index 403ea18..217f842 100644 --- a/chrome/service/cloud_print/cloud_print_proxy_backend.h +++ b/chrome/service/cloud_print/cloud_print_proxy_backend.h @@ -44,6 +44,8 @@ class CloudPrintProxyFrontend { virtual void OnUnregisterPrinters( const std::string& auth_token, const std::list<std::string>& printer_ids) = 0; + // Update and store service settings. + virtual void OnXmppPingUpdated(int ping_timeout) = 0; protected: // Don't delete through SyncFrontend interface. diff --git a/chrome/service/cloud_print/connector_settings.cc b/chrome/service/cloud_print/connector_settings.cc index f97a7ec..c2137e4 100644 --- a/chrome/service/cloud_print/connector_settings.cc +++ b/chrome/service/cloud_print/connector_settings.cc @@ -116,10 +116,10 @@ void ConnectorSettings::CopyFrom(const ConnectorSettings& source) { void ConnectorSettings::SetXmppPingTimeoutSec(int timeout) { xmpp_ping_timeout_sec_ = timeout; - if (xmpp_ping_timeout_sec_ < kMinimumXmppPingTimeoutSecs) { + if (xmpp_ping_timeout_sec_ < kMinXmppPingTimeoutSecs) { LOG(WARNING) << "CP_CONNECTOR: XMPP ping timeout is less then minimal value"; - xmpp_ping_timeout_sec_ = kMinimumXmppPingTimeoutSecs; + xmpp_ping_timeout_sec_ = kMinXmppPingTimeoutSecs; } } diff --git a/chrome/service/cloud_print/connector_settings.h b/chrome/service/cloud_print/connector_settings.h index ec811a40..18ce5af 100644 --- a/chrome/service/cloud_print/connector_settings.h +++ b/chrome/service/cloud_print/connector_settings.h @@ -55,6 +55,8 @@ class ConnectorSettings { bool ShouldConnect(const std::string& printer_name) const; + void SetXmppPingTimeoutSec(int timeout); + private: friend class ConnectorSettingsTest; FRIEND_TEST_ALL_PREFIXES(ConnectorSettingsTest, SettersTest); @@ -63,8 +65,6 @@ class ConnectorSettings { xmpp_ping_enabled_ = enabled; } - void SetXmppPingTimeoutSec(int timeout); - // Cloud Print server url. GURL server_url_; diff --git a/chrome/service/cloud_print/connector_settings_unittest.cc b/chrome/service/cloud_print/connector_settings_unittest.cc index 9586aa7..6645150 100644 --- a/chrome/service/cloud_print/connector_settings_unittest.cc +++ b/chrome/service/cloud_print/connector_settings_unittest.cc @@ -146,7 +146,7 @@ TEST_F(ConnectorSettingsTest, SettersTest) { // Set invalid settings, and check correct defaults. settings.SetXmppPingTimeoutSec(1); - EXPECT_EQ(settings.xmpp_ping_timeout_sec(), kMinimumXmppPingTimeoutSecs); + EXPECT_EQ(settings.xmpp_ping_timeout_sec(), kMinXmppPingTimeoutSecs); } } // namespace cloud_print diff --git a/chrome/service/cloud_print/printer_job_handler.cc b/chrome/service/cloud_print/printer_job_handler.cc index 22371b8..6a4f1bb 100644 --- a/chrome/service/cloud_print/printer_job_handler.cc +++ b/chrome/service/cloud_print/printer_job_handler.cc @@ -26,6 +26,10 @@ namespace cloud_print { +PrinterJobHandler::PrinterInfoFromCloud::PrinterInfoFromCloud() + : current_xmpp_timeout(0), pending_xmpp_timeout(0) { +} + PrinterJobHandler::PrinterJobHandler( const printing::PrinterBasicInfo& printer_info, const PrinterInfoFromCloud& printer_info_cloud, @@ -304,7 +308,7 @@ PrinterJobHandler::HandlePrintTicketResponse(const net::URLFetcher* source, accept_headers); } else { // The print ticket was not valid. We are done here. - FailedFetchingJobData(); + ValidatePrintTicketFailed(); } return CloudPrintURLFetcher::STOP_PROCESSING; } @@ -477,7 +481,7 @@ void PrinterJobHandler::UpdateJobStatus(PrintJobStatus status, request_ = CloudPrintURLFetcher::Create(); request_->StartGetRequest( GetUrlForJobStatusUpdate(cloud_print_server_url_, job_details_.job_id_, - status), + status, error), this, kCloudPrintAPIMaxRetryCount, std::string()); } @@ -569,12 +573,12 @@ bool PrinterJobHandler::HavePendingTasks() { return (job_check_pending_ || printer_update_pending_); } -void PrinterJobHandler::FailedFetchingJobData() { +void PrinterJobHandler::ValidatePrintTicketFailed() { if (!shutting_down_) { - LOG(ERROR) << "CP_CONNECTOR: Failed fetching job data" + LOG(ERROR) << "CP_CONNECTOR: Failed validating print ticket" << ", printer name: " << printer_info_.printer_name << ", job id: " << job_details_.job_id_; - JobFailed(INVALID_JOB_DATA); + JobFailed(VALIDATE_PRINT_TICKET_FAILED); } } @@ -636,6 +640,16 @@ void PrinterJobHandler::OnReceivePrinterCaps( base::StringPrintf("%d", printer_info.printer_status), mime_boundary, std::string(), &post_data); } + + // Add local_settings with a current XMPP ping interval. + if (printer_info_cloud_.pending_xmpp_timeout != 0) { + DCHECK(kMinXmppPingTimeoutSecs <= printer_info_cloud_.pending_xmpp_timeout); + net::AddMultipartValueForUpload(kPrinterLocalSettingsValue, + base::StringPrintf(kUpdateLocalSettingsXmppPingFormat, + printer_info_cloud_.current_xmpp_timeout), + mime_boundary, std::string(), &post_data); + } + printer_info_ = printer_info; if (!post_data.empty()) { net::AddMultipartFinalDelimiterForUpload(mime_boundary, &post_data); diff --git a/chrome/service/cloud_print/printer_job_handler.h b/chrome/service/cloud_print/printer_job_handler.h index fc74e77..10c74ed 100644 --- a/chrome/service/cloud_print/printer_job_handler.h +++ b/chrome/service/cloud_print/printer_job_handler.h @@ -85,6 +85,10 @@ class PrinterJobHandler : public base::RefCountedThreadSafe<PrinterJobHandler>, std::string printer_id; std::string caps_hash; std::string tags_hash; + int current_xmpp_timeout; + int pending_xmpp_timeout; + + PrinterInfoFromCloud(); }; // Begin public interface @@ -153,7 +157,7 @@ class PrinterJobHandler : public base::RefCountedThreadSafe<PrinterJobHandler>, enum PrintJobError { SUCCESS, JOB_DOWNLOAD_FAILED, - INVALID_JOB_DATA, + VALIDATE_PRINT_TICKET_FAILED, PRINT_FAILED, }; @@ -233,7 +237,7 @@ class PrinterJobHandler : public base::RefCountedThreadSafe<PrinterJobHandler>, // Returns false if printer info is up to date and no updating is needed. bool UpdatePrinterInfo(); bool HavePendingTasks(); - void FailedFetchingJobData(); + void ValidatePrintTicketFailed(); // Callback that asynchronously receives printer caps and defaults. void OnReceivePrinterCaps( @@ -283,6 +287,9 @@ class PrinterJobHandler : public base::RefCountedThreadSafe<PrinterJobHandler>, bool job_check_pending_; bool printer_update_pending_; + // Number of seconds between XMPP pings (for server registration) + int xmpp_ping_interval_; + // Some task in the state machine is in progress. bool task_in_progress_; scoped_refptr<PrintSystem::PrinterWatcher> printer_watcher_; diff --git a/chrome/service/cloud_print/printer_job_handler_unittest.cc b/chrome/service/cloud_print/printer_job_handler_unittest.cc index 13736d3..a41b3e8 100644 --- a/chrome/service/cloud_print/printer_job_handler_unittest.cc +++ b/chrome/service/cloud_print/printer_job_handler_unittest.cc @@ -231,7 +231,8 @@ std::string DownloadURI(int job_num) { std::string InProgressURI(int job_num) { return GetUrlForJobStatusUpdate(GURL(kExampleCloudPrintServerURL), StringPrintf(kExampleJobID, job_num), - PRINT_JOB_STATUS_IN_PROGRESS).spec(); + PRINT_JOB_STATUS_IN_PROGRESS, + 0).spec(); } std::string StatusResponse(int job_num, const char* status_string) { @@ -474,6 +475,8 @@ void PrinterJobHandlerTest::SetUp() { info_from_cloud_.tags_hash = GetHashOfPrinterInfo(basic_info_); info_from_cloud_.caps_hash = base::MD5String(kExamplePrinterCapabilities); + info_from_cloud_.current_xmpp_timeout = 300; + info_from_cloud_.pending_xmpp_timeout = 0; caps_and_defaults_.printer_capabilities = kExamplePrinterCapabilities; caps_and_defaults_.caps_mime_type = kExampleCapsMimeType; |