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

Side by Side Diff: chrome/browser/profiles/gaia_info_update_service_unittest.cc

Issue 338993007: Track when and how a profile is signed out via UMA. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: SignOut() param in Android tests Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profiles/gaia_info_update_service.h" 5 #include "chrome/browser/profiles/gaia_info_update_service.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile_downloader.h" 10 #include "chrome/browser/profiles/profile_downloader.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 gfx::Image gaia_picture = gfx::test::CreateImage(); 166 gfx::Image gaia_picture = gfx::test::CreateImage();
167 GetCache()->SetGAIAPictureOfProfileAtIndex(0, &gaia_picture); 167 GetCache()->SetGAIAPictureOfProfileAtIndex(0, &gaia_picture);
168 168
169 // Set a fake picture URL. 169 // Set a fake picture URL.
170 profile()->GetPrefs()->SetString(prefs::kProfileGAIAInfoPictureURL, 170 profile()->GetPrefs()->SetString(prefs::kProfileGAIAInfoPictureURL,
171 "example.com"); 171 "example.com");
172 172
173 EXPECT_FALSE(service()->GetCachedPictureURL().empty()); 173 EXPECT_FALSE(service()->GetCachedPictureURL().empty());
174 174
175 // Log out. 175 // Log out.
176 signin_manager->SignOut(); 176 signin_manager->SignOut(signin_metrics::SIGNOUT_TEST);
177 // Verify that the GAIA name and picture, and picture URL are unset. 177 // Verify that the GAIA name and picture, and picture URL are unset.
178 EXPECT_TRUE(GetCache()->GetGAIANameOfProfileAtIndex(0).empty()); 178 EXPECT_TRUE(GetCache()->GetGAIANameOfProfileAtIndex(0).empty());
179 EXPECT_EQ(NULL, GetCache()->GetGAIAPictureOfProfileAtIndex(0)); 179 EXPECT_EQ(NULL, GetCache()->GetGAIAPictureOfProfileAtIndex(0));
180 EXPECT_TRUE(service()->GetCachedPictureURL().empty()); 180 EXPECT_TRUE(service()->GetCachedPictureURL().empty());
181 } 181 }
182 182
183 TEST_F(GAIAInfoUpdateServiceTest, LogIn) { 183 TEST_F(GAIAInfoUpdateServiceTest, LogIn) {
184 // Log in. 184 // Log in.
185 EXPECT_CALL(*service(), Update()); 185 EXPECT_CALL(*service(), Update());
186 SigninManager* signin_manager = 186 SigninManager* signin_manager =
187 SigninManagerFactory::GetForProfile(profile()); 187 SigninManagerFactory::GetForProfile(profile());
188 signin_manager->OnExternalSigninCompleted("pat@example.com"); 188 signin_manager->OnExternalSigninCompleted("pat@example.com");
189 } 189 }
190 190
191 #endif 191 #endif
OLDNEW
« no previous file with comments | « chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc ('k') | chrome/browser/services/gcm/fake_signin_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698