Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_policy_browsertest.cc

Issue 2606773002: Setup Chromad user policy plumbing (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 #include "base/numerics/safe_conversions.h" 21 #include "base/numerics/safe_conversions.h"
22 #include "base/path_service.h" 22 #include "base/path_service.h"
23 #include "base/run_loop.h" 23 #include "base/run_loop.h"
24 #include "chrome/browser/chromeos/login/login_manager_test.h" 24 #include "chrome/browser/chromeos/login/login_manager_test.h"
25 #include "chrome/browser/chromeos/login/startup_utils.h" 25 #include "chrome/browser/chromeos/login/startup_utils.h"
26 #include "chrome/browser/chromeos/login/ui/login_display_host.h" 26 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
27 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" 27 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
28 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 28 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
29 #include "chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_u til.h" 29 #include "chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_u til.h"
30 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" 30 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
31 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h" 31 #include "chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.h"
32 #include "chrome/browser/chromeos/profiles/profile_helper.h" 32 #include "chrome/browser/chromeos/profiles/profile_helper.h"
33 #include "chrome/browser/chromeos/settings/stub_install_attributes.h" 33 #include "chrome/browser/chromeos/settings/stub_install_attributes.h"
34 #include "chrome/browser/profiles/profile.h" 34 #include "chrome/browser/profiles/profile.h"
35 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 35 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
36 #include "chrome/common/chrome_paths.h" 36 #include "chrome/common/chrome_paths.h"
37 #include "chromeos/chromeos_paths.h" 37 #include "chromeos/chromeos_paths.h"
38 #include "chromeos/chromeos_switches.h" 38 #include "chromeos/chromeos_switches.h"
39 #include "chromeos/cryptohome/system_salt_getter.h" 39 #include "chromeos/cryptohome/system_salt_getter.h"
40 #include "chromeos/dbus/cryptohome_client.h" 40 #include "chromeos/dbus/cryptohome_client.h"
41 #include "chromeos/dbus/dbus_thread_manager.h" 41 #include "chromeos/dbus/dbus_thread_manager.h"
(...skipping 26 matching lines...) Expand all
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::UserPolicyManagerFactoryChromeOS::GetCloudPolicyManagerForProfile(
79 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698