| 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/wallpaper/wallpaper_manager.h" | 5 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| 6 | 6 |
| 7 #include "ash/desktop_background/desktop_background_controller.h" | 7 #include "ash/desktop_background/desktop_background_controller.h" |
| 8 #include "ash/desktop_background/desktop_background_controller_observer.h" | 8 #include "ash/desktop_background/desktop_background_controller_observer.h" |
| 9 #include "ash/desktop_background/desktop_background_controller_test_api.h" | 9 #include "ash/desktop_background/desktop_background_controller_test_api.h" |
| 10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 WallpaperManager::Get()->GetAppropriateResolution()); | 690 WallpaperManager::Get()->GetAppropriateResolution()); |
| 691 EXPECT_EQ(1, observer.GetUpdateWallpaperCountAndReset()); | 691 EXPECT_EQ(1, observer.GetUpdateWallpaperCountAndReset()); |
| 692 UpdateDisplay("1366x800/r"); | 692 UpdateDisplay("1366x800/r"); |
| 693 // Wait for asynchronous DisplayBackgroundController::UpdateDisplay() call. | 693 // Wait for asynchronous DisplayBackgroundController::UpdateDisplay() call. |
| 694 base::RunLoop().RunUntilIdle(); | 694 base::RunLoop().RunUntilIdle(); |
| 695 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); | 695 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
| 696 EXPECT_EQ(WallpaperManager::WALLPAPER_RESOLUTION_LARGE, | 696 EXPECT_EQ(WallpaperManager::WALLPAPER_RESOLUTION_LARGE, |
| 697 WallpaperManager::Get()->GetAppropriateResolution()); | 697 WallpaperManager::Get()->GetAppropriateResolution()); |
| 698 EXPECT_EQ(1, observer.GetUpdateWallpaperCountAndReset()); | 698 EXPECT_EQ(1, observer.GetUpdateWallpaperCountAndReset()); |
| 699 | 699 |
| 700 // Max display size didn't chagne. | 700 // Max display size didn't change. |
| 701 UpdateDisplay("900x800/r,400x1366"); | 701 UpdateDisplay("900x800/r,400x1366"); |
| 702 // Wait for asynchronous DisplayBackgroundController::UpdateDisplay() call. | 702 // Wait for asynchronous DisplayBackgroundController::UpdateDisplay() call. |
| 703 base::RunLoop().RunUntilIdle(); | 703 base::RunLoop().RunUntilIdle(); |
| 704 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); | 704 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
| 705 EXPECT_EQ(0, observer.GetUpdateWallpaperCountAndReset()); | 705 EXPECT_EQ(0, observer.GetUpdateWallpaperCountAndReset()); |
| 706 } | 706 } |
| 707 | 707 |
| 708 // Test that WallpaperManager loads the appropriate wallpaper | 708 // Test that WallpaperManager loads the appropriate wallpaper |
| 709 // images as specified via command-line flags in various situations. | 709 // images as specified via command-line flags in various situations. |
| 710 // Splitting these into separate tests avoids needing to run animations. | 710 // Splitting these into separate tests avoids needing to run animations. |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 | 836 |
| 837 WallpaperManager::Get()->SetDefaultWallpaperNow(std::string()); | 837 WallpaperManager::Get()->SetDefaultWallpaperNow(std::string()); |
| 838 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); | 838 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
| 839 | 839 |
| 840 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor( | 840 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor( |
| 841 controller_->GetWallpaper(), | 841 controller_->GetWallpaper(), |
| 842 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor)); | 842 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor)); |
| 843 } | 843 } |
| 844 | 844 |
| 845 } // namespace chromeos | 845 } // namespace chromeos |
| OLD | NEW |