OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <map> | 5 #include <map> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 reinterpret_cast<UserImageManagerImpl*>( | 229 reinterpret_cast<UserImageManagerImpl*>( |
230 ChromeUserManager::Get()->GetUserImageManager(username)) | 230 ChromeUserManager::Get()->GetUserImageManager(username)) |
231 ->profile_downloader_.get(); | 231 ->profile_downloader_.get(); |
232 ASSERT_TRUE(profile_downloader); | 232 ASSERT_TRUE(profile_downloader); |
233 | 233 |
234 static_cast<OAuth2TokenService::Consumer*>(profile_downloader)-> | 234 static_cast<OAuth2TokenService::Consumer*>(profile_downloader)-> |
235 OnGetTokenSuccess(NULL, | 235 OnGetTokenSuccess(NULL, |
236 std::string(), | 236 std::string(), |
237 base::Time::Now() + base::TimeDelta::FromDays(1)); | 237 base::Time::Now() + base::TimeDelta::FromDays(1)); |
238 | 238 |
239 net::TestURLFetcher* fetcher = | 239 net::TestURLFetcher* fetcher = url_fetcher_factory->GetFetcherByID( |
240 url_fetcher_factory->GetFetcherByID(0); | 240 gaia::GaiaOAuthClient::kUrlFetcherId); |
241 ASSERT_TRUE(fetcher); | 241 ASSERT_TRUE(fetcher); |
242 fetcher->SetResponseString( | 242 fetcher->SetResponseString( |
243 "{ \"picture\": \"http://localhost/avatar.jpg\" }"); | 243 "{ \"picture\": \"http://localhost/avatar.jpg\" }"); |
244 fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS, | 244 fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS, |
245 net::OK)); | 245 net::OK)); |
246 fetcher->set_response_code(200); | 246 fetcher->set_response_code(200); |
247 fetcher->delegate()->OnURLFetchComplete(fetcher); | 247 fetcher->delegate()->OnURLFetchComplete(fetcher); |
248 base::RunLoop().RunUntilIdle(); | 248 base::RunLoop().RunUntilIdle(); |
249 } | 249 } |
250 | 250 |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 | 885 |
886 saved_image = test::ImageLoader(GetUserImagePath(kTestUser1, "jpg")).Load(); | 886 saved_image = test::ImageLoader(GetUserImagePath(kTestUser1, "jpg")).Load(); |
887 ASSERT_TRUE(saved_image); | 887 ASSERT_TRUE(saved_image); |
888 | 888 |
889 // Check image dimensions. Images can't be compared since JPEG is lossy. | 889 // Check image dimensions. Images can't be compared since JPEG is lossy. |
890 EXPECT_EQ(policy_image_->width(), saved_image->width()); | 890 EXPECT_EQ(policy_image_->width(), saved_image->width()); |
891 EXPECT_EQ(policy_image_->height(), saved_image->height()); | 891 EXPECT_EQ(policy_image_->height(), saved_image->height()); |
892 } | 892 } |
893 | 893 |
894 } // namespace chromeos | 894 } // namespace chromeos |
OLD | NEW |