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/gcm_profile_service_unittest.cc

Issue 296053011: Start and stop the GCM service on demand (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 6 years, 7 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_driver_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | 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 e4d170d61cfc6e563d6d80b750e191b902d353dd..7a6f2604b575370abd06dafa4ac75055bff6b327 100644
--- a/chrome/browser/services/gcm/gcm_profile_service_unittest.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service_unittest.cc
@@ -11,6 +11,7 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "base/run_loop.h"
+#include "chrome/browser/services/gcm/fake_gcm_app_handler.h"
#include "chrome/browser/services/gcm/fake_gcm_client.h"
#include "chrome/browser/services/gcm/fake_gcm_client_factory.h"
#include "chrome/browser/services/gcm/fake_signin_manager.h"
@@ -54,6 +55,7 @@ class GCMProfileServiceTest : public testing::Test {
// testing::Test:
virtual void SetUp() OVERRIDE;
+ virtual void TearDown() OVERRIDE;
FakeGCMClient* GetGCMClient() const;
@@ -83,6 +85,7 @@ class GCMProfileServiceTest : public testing::Test {
content::TestBrowserThreadBundle thread_bundle_;
scoped_ptr<TestingProfile> profile_;
GCMProfileService* gcm_profile_service_;
+ scoped_ptr<FakeGCMAppHandler> gcm_app_handler_;
std::string registration_id_;
GCMClient::Result registration_result_;
@@ -95,6 +98,7 @@ class GCMProfileServiceTest : public testing::Test {
GCMProfileServiceTest::GCMProfileServiceTest()
: gcm_profile_service_(NULL),
+ gcm_app_handler_(new FakeGCMAppHandler),
registration_result_(GCMClient::UNKNOWN_ERROR),
send_result_(GCMClient::UNKNOWN_ERROR) {
}
@@ -117,6 +121,8 @@ void GCMProfileServiceTest::SetUp() {
GCMProfileServiceFactory::GetInstance()->SetTestingFactoryAndUse(
profile_.get(),
&BuildGCMProfileService));
+ gcm_profile_service_->driver()->AddAppHandler(
+ kTestAppID, gcm_app_handler_.get());
FakeSigninManager* signin_manager = static_cast<FakeSigninManager*>(
SigninManagerFactory::GetInstance()->GetForProfile(profile_.get()));
@@ -124,6 +130,10 @@ void GCMProfileServiceTest::SetUp() {
base::RunLoop().RunUntilIdle();
}
+void GCMProfileServiceTest::TearDown() {
+ gcm_profile_service_->driver()->RemoveAppHandler(kTestAppID);
+}
+
void GCMProfileServiceTest::RegisterAndWaitForCompletion(
const std::vector<std::string>& sender_ids) {
base::RunLoop run_loop;
« no previous file with comments | « chrome/browser/services/gcm/gcm_driver_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698