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/prefs/pref_service_syncable.h" | 10 #include "chrome/browser/prefs/pref_service_syncable.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 std::string url("foo.com"); | 128 std::string url("foo.com"); |
129 ProfileDownloadSuccess(full_name, given_name, image, url, base::string16()); | 129 ProfileDownloadSuccess(full_name, given_name, image, url, base::string16()); |
130 | 130 |
131 // Make sure the right profile was updated correctly. | 131 // Make sure the right profile was updated correctly. |
132 size_t index = GetCache()->GetIndexOfProfileWithPath(profile()->GetPath()); | 132 size_t index = GetCache()->GetIndexOfProfileWithPath(profile()->GetPath()); |
133 EXPECT_EQ(full_name, GetCache()->GetGAIANameOfProfileAtIndex(index)); | 133 EXPECT_EQ(full_name, GetCache()->GetGAIANameOfProfileAtIndex(index)); |
134 EXPECT_EQ(given_name, GetCache()->GetGAIAGivenNameOfProfileAtIndex(index)); | 134 EXPECT_EQ(given_name, GetCache()->GetGAIAGivenNameOfProfileAtIndex(index)); |
135 } | 135 } |
136 | 136 |
137 private: | 137 private: |
138 virtual void SetUp() OVERRIDE; | 138 virtual void SetUp() override; |
139 virtual void TearDown() OVERRIDE; | 139 virtual void TearDown() override; |
140 | 140 |
141 Profile* profile_; | 141 Profile* profile_; |
142 scoped_ptr<NiceMock<GAIAInfoUpdateServiceMock> > service_; | 142 scoped_ptr<NiceMock<GAIAInfoUpdateServiceMock> > service_; |
143 scoped_ptr<NiceMock<ProfileDownloaderMock> > downloader_; | 143 scoped_ptr<NiceMock<ProfileDownloaderMock> > downloader_; |
144 }; | 144 }; |
145 | 145 |
146 void GAIAInfoUpdateServiceTest::SetUp() { | 146 void GAIAInfoUpdateServiceTest::SetUp() { |
147 ProfileInfoCacheTest::SetUp(); | 147 ProfileInfoCacheTest::SetUp(); |
148 service_.reset(new NiceMock<GAIAInfoUpdateServiceMock>(profile())); | 148 service_.reset(new NiceMock<GAIAInfoUpdateServiceMock>(profile())); |
149 downloader_.reset(new NiceMock<ProfileDownloaderMock>(service())); | 149 downloader_.reset(new NiceMock<ProfileDownloaderMock>(service())); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 302 |
303 TEST_F(GAIAInfoUpdateServiceTest, LogIn) { | 303 TEST_F(GAIAInfoUpdateServiceTest, LogIn) { |
304 // Log in. | 304 // Log in. |
305 EXPECT_CALL(*service(), Update()); | 305 EXPECT_CALL(*service(), Update()); |
306 SigninManager* signin_manager = | 306 SigninManager* signin_manager = |
307 SigninManagerFactory::GetForProfile(profile()); | 307 SigninManagerFactory::GetForProfile(profile()); |
308 signin_manager->OnExternalSigninCompleted("pat@example.com"); | 308 signin_manager->OnExternalSigninCompleted("pat@example.com"); |
309 } | 309 } |
310 | 310 |
311 #endif | 311 #endif |
OLD | NEW |