| 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 "chrome/browser/chromeos/login/users/avatar/user_image_manager.h" | 5 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 const char kTestUser1[] = "test-user@gmail.com"; | 86 const char kTestUser1[] = "test-user@gmail.com"; |
| 87 const char kTestUser2[] = "test-user2@gmail.com"; | 87 const char kTestUser2[] = "test-user2@gmail.com"; |
| 88 | 88 |
| 89 policy::CloudPolicyStore* GetStoreForUser(const user_manager::User* user) { | 89 policy::CloudPolicyStore* GetStoreForUser(const user_manager::User* user) { |
| 90 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user); | 90 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user); |
| 91 if (!profile) { | 91 if (!profile) { |
| 92 ADD_FAILURE(); | 92 ADD_FAILURE(); |
| 93 return NULL; | 93 return NULL; |
| 94 } | 94 } |
| 95 policy::UserCloudPolicyManagerChromeOS* policy_manager = | 95 policy::UserCloudPolicyManagerChromeOS* policy_manager = |
| 96 policy::UserCloudPolicyManagerFactoryChromeOS::GetForProfile(profile); | 96 policy::UserCloudPolicyManagerFactoryChromeOS:: |
| 97 GetCloudPolicyManagerForProfile(profile); |
| 97 if (!policy_manager) { | 98 if (!policy_manager) { |
| 98 ADD_FAILURE(); | 99 ADD_FAILURE(); |
| 99 return NULL; | 100 return NULL; |
| 100 } | 101 } |
| 101 return policy_manager->core()->store(); | 102 return policy_manager->core()->store(); |
| 102 } | 103 } |
| 103 | 104 |
| 104 class UserImageChangeWaiter : public user_manager::UserManager::Observer { | 105 class UserImageChangeWaiter : public user_manager::UserManager::Observer { |
| 105 public: | 106 public: |
| 106 UserImageChangeWaiter() {} | 107 UserImageChangeWaiter() {} |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 saved_image = | 873 saved_image = |
| 873 test::ImageLoader(GetUserImagePath(enterprise_account_id_, "jpg")).Load(); | 874 test::ImageLoader(GetUserImagePath(enterprise_account_id_, "jpg")).Load(); |
| 874 ASSERT_TRUE(saved_image); | 875 ASSERT_TRUE(saved_image); |
| 875 | 876 |
| 876 // Check image dimensions. Images can't be compared since JPEG is lossy. | 877 // Check image dimensions. Images can't be compared since JPEG is lossy. |
| 877 EXPECT_EQ(policy_image_->width(), saved_image->width()); | 878 EXPECT_EQ(policy_image_->width(), saved_image->width()); |
| 878 EXPECT_EQ(policy_image_->height(), saved_image->height()); | 879 EXPECT_EQ(policy_image_->height(), saved_image->height()); |
| 879 } | 880 } |
| 880 | 881 |
| 881 } // namespace chromeos | 882 } // namespace chromeos |
| OLD | NEW |