| 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 | 5 |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "ash/desktop_background/desktop_background_controller.h" | 8 #include "ash/desktop_background/desktop_background_controller.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 : finished_(false), | 61 : finished_(false), |
| 62 wallpaper_manager_(wallpaper_manager) { | 62 wallpaper_manager_(wallpaper_manager) { |
| 63 DCHECK(wallpaper_manager_); | 63 DCHECK(wallpaper_manager_); |
| 64 wallpaper_manager_->AddObserver(this); | 64 wallpaper_manager_->AddObserver(this); |
| 65 } | 65 } |
| 66 | 66 |
| 67 virtual ~TestWallpaperObserver() { | 67 virtual ~TestWallpaperObserver() { |
| 68 wallpaper_manager_->RemoveObserver(this); | 68 wallpaper_manager_->RemoveObserver(this); |
| 69 } | 69 } |
| 70 | 70 |
| 71 virtual void OnWallpaperAnimationFinished(const std::string&) OVERRIDE { | 71 virtual void OnWallpaperAnimationFinished(const std::string&) override { |
| 72 finished_ = true; | 72 finished_ = true; |
| 73 base::MessageLoop::current()->Quit(); | 73 base::MessageLoop::current()->Quit(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void WaitForWallpaperAnimationFinished() { | 76 void WaitForWallpaperAnimationFinished() { |
| 77 while (!finished_) | 77 while (!finished_) |
| 78 base::RunLoop().Run(); | 78 base::RunLoop().Run(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 private: | 81 private: |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 class CustomizationWallpaperDownloaderBrowserTest | 219 class CustomizationWallpaperDownloaderBrowserTest |
| 220 : public InProcessBrowserTest { | 220 : public InProcessBrowserTest { |
| 221 public: | 221 public: |
| 222 CustomizationWallpaperDownloaderBrowserTest() | 222 CustomizationWallpaperDownloaderBrowserTest() |
| 223 : controller_(NULL), | 223 : controller_(NULL), |
| 224 local_state_(NULL) { | 224 local_state_(NULL) { |
| 225 } | 225 } |
| 226 | 226 |
| 227 virtual ~CustomizationWallpaperDownloaderBrowserTest() {} | 227 virtual ~CustomizationWallpaperDownloaderBrowserTest() {} |
| 228 | 228 |
| 229 virtual void SetUpOnMainThread() OVERRIDE { | 229 virtual void SetUpOnMainThread() override { |
| 230 controller_ = ash::Shell::GetInstance()->desktop_background_controller(); | 230 controller_ = ash::Shell::GetInstance()->desktop_background_controller(); |
| 231 local_state_ = g_browser_process->local_state(); | 231 local_state_ = g_browser_process->local_state(); |
| 232 } | 232 } |
| 233 | 233 |
| 234 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 234 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 235 command_line->AppendSwitch(chromeos::switches::kLoginManager); | 235 command_line->AppendSwitch(chromeos::switches::kLoginManager); |
| 236 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); | 236 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); |
| 237 } | 237 } |
| 238 | 238 |
| 239 virtual void TearDownOnMainThread() OVERRIDE { controller_ = NULL; } | 239 virtual void TearDownOnMainThread() override { controller_ = NULL; } |
| 240 | 240 |
| 241 protected: | 241 protected: |
| 242 void CreateCmdlineWallpapers() { | 242 void CreateCmdlineWallpapers() { |
| 243 cmdline_wallpaper_dir_.reset(new base::ScopedTempDir); | 243 cmdline_wallpaper_dir_.reset(new base::ScopedTempDir); |
| 244 ASSERT_TRUE(cmdline_wallpaper_dir_->CreateUniqueTempDir()); | 244 ASSERT_TRUE(cmdline_wallpaper_dir_->CreateUniqueTempDir()); |
| 245 wallpaper_manager_test_utils::CreateCmdlineWallpapers( | 245 wallpaper_manager_test_utils::CreateCmdlineWallpapers( |
| 246 *cmdline_wallpaper_dir_, &wallpaper_manager_command_line_); | 246 *cmdline_wallpaper_dir_, &wallpaper_manager_command_line_); |
| 247 } | 247 } |
| 248 | 248 |
| 249 ash::DesktopBackgroundController* controller_; | 249 ash::DesktopBackgroundController* controller_; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 | 311 |
| 312 observer.WaitForWallpaperAnimationFinished(); | 312 observer.WaitForWallpaperAnimationFinished(); |
| 313 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor( | 313 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor( |
| 314 controller_->GetWallpaper(), | 314 controller_->GetWallpaper(), |
| 315 wallpaper_manager_test_utils::kCustomWallpaperColor)); | 315 wallpaper_manager_test_utils::kCustomWallpaperColor)); |
| 316 | 316 |
| 317 EXPECT_EQ(2U, url_factory.num_attempts()); | 317 EXPECT_EQ(2U, url_factory.num_attempts()); |
| 318 } | 318 } |
| 319 | 319 |
| 320 } // namespace chromeos | 320 } // namespace chromeos |
| OLD | NEW |