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

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

Issue 130473002: [GCM] Make GCM API not work in incognito mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to land Created 6 years, 11 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/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 35daa3f738215f413742c9164307a636ae4f17da..240b7857045bc36de58ddbc997bd15d4bafad99b 100644
--- a/chrome/browser/services/gcm/gcm_profile_service_unittest.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service_unittest.cc
@@ -297,6 +297,20 @@ void GCMEventRouterMock::OnSendError(const std::string& app_id,
test_->SignalCompleted();
}
+TEST_F(GCMProfileServiceTest, Incognito) {
+ EXPECT_TRUE(GCMProfileServiceFactory::GetForProfile(profile()));
+
+ // Create an incognito profile.
+ TestingProfile::Builder incognito_profile_builder;
+ incognito_profile_builder.SetIncognito();
+ scoped_ptr<TestingProfile> incognito_profile =
+ incognito_profile_builder.Build();
+ incognito_profile->SetOriginalProfile(profile());
+
+ EXPECT_FALSE(GCMProfileServiceFactory::GetForProfile(
+ incognito_profile.get()));
+}
+
TEST_F(GCMProfileServiceTest, CheckIn) {
EXPECT_TRUE(checkin_info_.IsValid());

Powered by Google App Engine
This is Rietveld 408576698