OLD | NEW |
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 Loading... |
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 |
OLD | NEW |