| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 const SkColor kRedImageColor = SkColorSetARGB(255, 199, 6, 7); | 68 const SkColor kRedImageColor = SkColorSetARGB(255, 199, 6, 7); |
| 69 const SkColor kGreenImageColor = SkColorSetARGB(255, 38, 196, 15); | 69 const SkColor kGreenImageColor = SkColorSetARGB(255, 38, 196, 15); |
| 70 | 70 |
| 71 policy::CloudPolicyStore* GetStoreForUser(const user_manager::User* user) { | 71 policy::CloudPolicyStore* GetStoreForUser(const user_manager::User* user) { |
| 72 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user); | 72 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user); |
| 73 if (!profile) { | 73 if (!profile) { |
| 74 ADD_FAILURE(); | 74 ADD_FAILURE(); |
| 75 return NULL; | 75 return NULL; |
| 76 } | 76 } |
| 77 policy::UserCloudPolicyManagerChromeOS* policy_manager = | 77 policy::UserCloudPolicyManagerChromeOS* policy_manager = |
| 78 policy::UserCloudPolicyManagerFactoryChromeOS::GetForProfile(profile); | 78 policy::UserCloudPolicyManagerFactoryChromeOS:: |
| 79 GetCloudPolicyManagerForProfile(profile); |
| 79 if (!policy_manager) { | 80 if (!policy_manager) { |
| 80 ADD_FAILURE(); | 81 ADD_FAILURE(); |
| 81 return NULL; | 82 return NULL; |
| 82 } | 83 } |
| 83 return policy_manager->core()->store(); | 84 return policy_manager->core()->store(); |
| 84 } | 85 } |
| 85 | 86 |
| 86 // Compute the average ARGB color of |bitmap|. | 87 // Compute the average ARGB color of |bitmap|. |
| 87 SkColor ComputeAverageColor(const SkBitmap& bitmap) { | 88 SkColor ComputeAverageColor(const SkBitmap& bitmap) { |
| 88 if (bitmap.empty() || bitmap.width() < 1 || bitmap.height() < 1) { | 89 if (bitmap.empty() || bitmap.width() < 1 || bitmap.height() < 1) { |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 | 425 |
| 425 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, PersistOverLogout) { | 426 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, PersistOverLogout) { |
| 426 LoginUser(testUsers_[0].GetUserEmail()); | 427 LoginUser(testUsers_[0].GetUserEmail()); |
| 427 | 428 |
| 428 // Wait until wallpaper has been loaded. | 429 // Wait until wallpaper has been loaded. |
| 429 RunUntilWallpaperChangeCount(1); | 430 RunUntilWallpaperChangeCount(1); |
| 430 ASSERT_EQ(kRedImageColor, GetAverageWallpaperColor()); | 431 ASSERT_EQ(kRedImageColor, GetAverageWallpaperColor()); |
| 431 } | 432 } |
| 432 | 433 |
| 433 } // namespace chromeos | 434 } // namespace chromeos |
| OLD | NEW |