| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
| 11 #include "ash/desktop_background/desktop_background_controller_observer.h" | 11 #include "ash/desktop_background/desktop_background_controller_observer.h" |
| 12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
| 17 #include "base/json/json_writer.h" | 17 #include "base/json/json_writer.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 20 #include "base/path_service.h" | 20 #include "base/path_service.h" |
| 21 #include "base/run_loop.h" | 21 #include "base/run_loop.h" |
| 22 #include "chrome/browser/chromeos/login/login_manager_test.h" | 22 #include "chrome/browser/chromeos/login/login_manager_test.h" |
| 23 #include "chrome/browser/chromeos/login/startup_utils.h" | 23 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 24 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 24 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 25 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 25 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| 26 #include "chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_u
til.h" | 26 #include "chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_u
til.h" |
| 27 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 27 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
| 28 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" | 28 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" |
| 29 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 29 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 30 #include "chrome/browser/profiles/profile.h" | 30 #include "chrome/browser/profiles/profile.h" |
| 31 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 31 #include "chrome/common/chrome_paths.h" | 32 #include "chrome/common/chrome_paths.h" |
| 32 #include "chromeos/chromeos_paths.h" | 33 #include "chromeos/chromeos_paths.h" |
| 33 #include "chromeos/chromeos_switches.h" | 34 #include "chromeos/chromeos_switches.h" |
| 34 #include "chromeos/dbus/cryptohome_client.h" | 35 #include "chromeos/dbus/cryptohome_client.h" |
| 35 #include "chromeos/dbus/dbus_thread_manager.h" | 36 #include "chromeos/dbus/dbus_thread_manager.h" |
| 36 #include "chromeos/dbus/fake_session_manager_client.h" | 37 #include "chromeos/dbus/fake_session_manager_client.h" |
| 37 #include "chromeos/dbus/session_manager_client.h" | 38 #include "chromeos/dbus/session_manager_client.h" |
| 38 #include "components/policy/core/common/cloud/cloud_policy_core.h" | 39 #include "components/policy/core/common/cloud/cloud_policy_core.h" |
| 39 #include "components/policy/core/common/cloud/cloud_policy_store.h" | 40 #include "components/policy/core/common/cloud/cloud_policy_store.h" |
| 40 #include "components/policy/core/common/cloud/cloud_policy_validator.h" | 41 #include "components/policy/core/common/cloud/cloud_policy_validator.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 369 |
| 369 // Disabled due to flakiness: http://crbug.com/385648. | 370 // Disabled due to flakiness: http://crbug.com/385648. |
| 370 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, | 371 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, |
| 371 DISABLED_WallpaperOnLoginScreen) { | 372 DISABLED_WallpaperOnLoginScreen) { |
| 372 // Wait for active pod's wallpaper to be loaded. | 373 // Wait for active pod's wallpaper to be loaded. |
| 373 RunUntilWallpaperChangeCount(1); | 374 RunUntilWallpaperChangeCount(1); |
| 374 ASSERT_EQ(kGreenImageColor, GetAverageBackgroundColor()); | 375 ASSERT_EQ(kGreenImageColor, GetAverageBackgroundColor()); |
| 375 | 376 |
| 376 // Select the second pod (belonging to user 1). | 377 // Select the second pod (belonging to user 1). |
| 377 ASSERT_TRUE(content::ExecuteScript( | 378 ASSERT_TRUE(content::ExecuteScript( |
| 378 static_cast<chromeos::LoginDisplayHostImpl*>( | 379 LoginDisplayHost::default_host()->GetOobeUI()->web_ui()->GetWebContents(), |
| 379 chromeos::LoginDisplayHostImpl::default_host())->GetOobeUI()-> | |
| 380 web_ui()->GetWebContents(), | |
| 381 "document.getElementsByClassName('pod')[1].focus();")); | 380 "document.getElementsByClassName('pod')[1].focus();")); |
| 382 RunUntilWallpaperChangeCount(2); | 381 RunUntilWallpaperChangeCount(2); |
| 383 ASSERT_EQ(kRedImageColor, GetAverageBackgroundColor()); | 382 ASSERT_EQ(kRedImageColor, GetAverageBackgroundColor()); |
| 384 } | 383 } |
| 385 | 384 |
| 386 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, PRE_PRE_PersistOverLogout) { | 385 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, PRE_PRE_PersistOverLogout) { |
| 387 RegisterUser(testUsers_[0].GetUserEmail()); | 386 RegisterUser(testUsers_[0].GetUserEmail()); |
| 388 StartupUtils::MarkOobeCompleted(); | 387 StartupUtils::MarkOobeCompleted(); |
| 389 } | 388 } |
| 390 | 389 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 404 | 403 |
| 405 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, PersistOverLogout) { | 404 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, PersistOverLogout) { |
| 406 LoginUser(testUsers_[0].GetUserEmail()); | 405 LoginUser(testUsers_[0].GetUserEmail()); |
| 407 | 406 |
| 408 // Wait until wallpaper has been loaded. | 407 // Wait until wallpaper has been loaded. |
| 409 RunUntilWallpaperChangeCount(1); | 408 RunUntilWallpaperChangeCount(1); |
| 410 ASSERT_EQ(kRedImageColor, GetAverageBackgroundColor()); | 409 ASSERT_EQ(kRedImageColor, GetAverageBackgroundColor()); |
| 411 } | 410 } |
| 412 | 411 |
| 413 } // namespace chromeos | 412 } // namespace chromeos |
| OLD | NEW |