Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: chrome/browser/services/gcm/push_messaging_service_impl.cc

Issue 648623003: PushMessagingBrowserTest for registration success and failure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Rebase. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/services/gcm/push_messaging_service_impl.cc
diff --git a/chrome/browser/services/gcm/push_messaging_service_impl.cc b/chrome/browser/services/gcm/push_messaging_service_impl.cc
index ee49c0a12921645e09c7dcb76adb53a4cebe77ad..da1351cf20ff1717d11d13e12ecc5affbdf18d2a 100644
--- a/chrome/browser/services/gcm/push_messaging_service_impl.cc
+++ b/chrome/browser/services/gcm/push_messaging_service_impl.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/services/gcm/gcm_profile_service.h"
#include "chrome/browser/services/gcm/gcm_profile_service_factory.h"
#include "chrome/browser/services/gcm/push_messaging_application_id.h"
+#include "chrome/browser/services/gcm/push_messaging_constants.h"
#include "chrome/browser/services/gcm/push_messaging_permission_context.h"
#include "chrome/browser/services/gcm/push_messaging_permission_context_factory.h"
#include "chrome/common/chrome_switches.h"
@@ -233,7 +234,7 @@ void PushMessagingServiceImpl::RegisterEnd(
const content::PushMessagingService::RegisterCallback& callback,
const std::string& registration_id,
content::PushRegistrationStatus status) {
- GURL endpoint = GURL("https://android.googleapis.com/gcm/send");
+ GURL endpoint = GURL(std::string(kPushMessagingEndpoint));
callback.Run(endpoint, registration_id, status);
if (status == content::PUSH_REGISTRATION_STATUS_SUCCESS) {
// TODO(johnme): Make sure the pref doesn't get out of sync after crashes.
@@ -255,6 +256,10 @@ void PushMessagingServiceImpl::DidRegister(
RegisterEnd(callback, registration_id, status);
}
+void PushMessagingServiceImpl::SetProfileForTesting(Profile* profile) {
+ profile_ = profile;
+}
+
void PushMessagingServiceImpl::DidRequestPermission(
const PushMessagingApplicationId& application_id,
const std::string& sender_id,

Powered by Google App Engine
This is Rietveld 408576698