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

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

Issue 189803002: [GCM] Observe the event listener adding such that GCM can be started (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix trybots Created 6 years, 9 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
« no previous file with comments | « chrome/browser/services/gcm/gcm_profile_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/services/gcm/gcm_profile_service_unittest.cc
diff --git a/chrome/browser/services/gcm/gcm_profile_service_unittest.cc b/chrome/browser/services/gcm/gcm_profile_service_unittest.cc
index 2ab485a2f1d747799765a696d211908c4ed47b0c..1ac5a618dc309b6f9225c5db820664b52e8b4cfd 100644
--- a/chrome/browser/services/gcm/gcm_profile_service_unittest.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service_unittest.cc
@@ -29,6 +29,8 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/test/test_browser_thread_bundle.h"
+#include "extensions/browser/event_router.h"
+#include "extensions/browser/extension_prefs.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -283,6 +285,12 @@ class GCMProfileServiceTestConsumer : public GCMProfileService::TestingDelegate{
CommandLine::ForCurrentProcess(), base::FilePath(), false);
extension_service_ = extension_system->Get(profile())->extension_service();
+ // EventRouter is needed for GcmJsEventRouter.
+ if (!extension_system->event_router()) {
+ extension_system->SetEventRouter(scoped_ptr<EventRouter>(
+ new EventRouter(profile(), ExtensionPrefs::Get(profile()))));
+ }
+
// Enable GCM such that tests could be run on all channels.
profile()->GetPrefs()->SetBoolean(prefs::kGCMChannelEnabled, true);
« no previous file with comments | « chrome/browser/services/gcm/gcm_profile_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698