| Index: chrome/browser/services/gcm/gcm_client_mock.cc
|
| diff --git a/chrome/browser/services/gcm/gcm_client_mock.cc b/chrome/browser/services/gcm/gcm_client_mock.cc
|
| index 656fe558b366fe9eb15284a6bcef253227a7f59f..730e4779a3536337d19ed6fcae469330989d0b64 100644
|
| --- a/chrome/browser/services/gcm/gcm_client_mock.cc
|
| +++ b/chrome/browser/services/gcm/gcm_client_mock.cc
|
| @@ -60,12 +60,12 @@ void GCMClientMock::CheckOut() {
|
|
|
| void GCMClientMock::Register(const std::string& app_id,
|
| const std::string& cert,
|
| - const std::vector<std::string>& sender_ids) {
|
| + const std::string& sender_id) {
|
| DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
|
|
|
| std::string registration_id;
|
| if (error_simulation_ == ALWAYS_SUCCEED)
|
| - registration_id = GetRegistrationIdFromSenderIds(sender_ids);
|
| + registration_id = GetRegistrationIdFromSenderId(sender_id);
|
|
|
| base::MessageLoop::current()->PostTask(
|
| FROM_HERE,
|
| @@ -125,25 +125,14 @@ void GCMClientMock::DeleteMessages(const std::string& app_id) {
|
| }
|
|
|
| // static
|
| -std::string GCMClientMock::GetRegistrationIdFromSenderIds(
|
| - const std::vector<std::string>& sender_ids) {
|
| - // GCMProfileService normalizes the sender IDs by making them sorted.
|
| - std::vector<std::string> normalized_sender_ids = sender_ids;
|
| - std::sort(normalized_sender_ids.begin(), normalized_sender_ids.end());
|
| -
|
| - // Simulate the registration_id by concaternating all sender IDs.
|
| - // Set registration_id to empty to denote an error if sender_ids contains a
|
| +std::string GCMClientMock::GetRegistrationIdFromSenderId(
|
| + const std::string& sender_id) {
|
| + // Simulate the registration_id by appending reg_id to the sender ID.
|
| + // Set registration_id to empty to denote an error if sender_id contains a
|
| // hint.
|
| - std::string registration_id;
|
| - if (sender_ids.size() != 1 ||
|
| - sender_ids[0].find("error") == std::string::npos) {
|
| - for (size_t i = 0; i < normalized_sender_ids.size(); ++i) {
|
| - if (i > 0)
|
| - registration_id += ",";
|
| - registration_id += normalized_sender_ids[i];
|
| - }
|
| - }
|
| - return registration_id;
|
| + if (sender_id.find("error") == std::string::npos)
|
| + return sender_id + "_reg_id";
|
| + return std::string();
|
| }
|
|
|
| void GCMClientMock::CheckinFinished() {
|
|
|