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

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

Issue 623293003: replace OVERRIDE and FINAL with override and final in chrome/browser/chromeos/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: run git cl format on echo_dialog_view.h Created 6 years, 2 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 "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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } // namespace 57 } // namespace
58 58
59 class WallpaperManagerBrowserTest : public InProcessBrowserTest { 59 class WallpaperManagerBrowserTest : public InProcessBrowserTest {
60 public: 60 public:
61 WallpaperManagerBrowserTest () : controller_(NULL), 61 WallpaperManagerBrowserTest () : controller_(NULL),
62 local_state_(NULL) { 62 local_state_(NULL) {
63 } 63 }
64 64
65 virtual ~WallpaperManagerBrowserTest () {} 65 virtual ~WallpaperManagerBrowserTest () {}
66 66
67 virtual void SetUpOnMainThread() OVERRIDE { 67 virtual void SetUpOnMainThread() override {
68 controller_ = ash::Shell::GetInstance()->desktop_background_controller(); 68 controller_ = ash::Shell::GetInstance()->desktop_background_controller();
69 local_state_ = g_browser_process->local_state(); 69 local_state_ = g_browser_process->local_state();
70 DesktopBackgroundController::TestAPI(controller_) 70 DesktopBackgroundController::TestAPI(controller_)
71 .set_wallpaper_reload_delay_for_test(0); 71 .set_wallpaper_reload_delay_for_test(0);
72 UpdateDisplay("800x600"); 72 UpdateDisplay("800x600");
73 } 73 }
74 74
75 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 75 virtual void SetUpCommandLine(CommandLine* command_line) override {
76 command_line->AppendSwitch(switches::kLoginManager); 76 command_line->AppendSwitch(switches::kLoginManager);
77 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); 77 command_line->AppendSwitchASCII(switches::kLoginProfile, "user");
78 } 78 }
79 79
80 virtual void TearDownOnMainThread() OVERRIDE { 80 virtual void TearDownOnMainThread() override {
81 controller_ = NULL; 81 controller_ = NULL;
82 } 82 }
83 83
84 // Update the display configuration as given in |display_specs|. See 84 // Update the display configuration as given in |display_specs|. See
85 // ash::test::DisplayManagerTestApi::UpdateDisplay for more details. 85 // ash::test::DisplayManagerTestApi::UpdateDisplay for more details.
86 void UpdateDisplay(const std::string& display_specs) { 86 void UpdateDisplay(const std::string& display_specs) {
87 ash::test::DisplayManagerTestApi display_manager_test_api( 87 ash::test::DisplayManagerTestApi display_manager_test_api(
88 ash::Shell::GetInstance()->display_manager()); 88 ash::Shell::GetInstance()->display_manager());
89 display_manager_test_api.UpdateDisplay(display_specs); 89 display_manager_test_api.UpdateDisplay(display_specs);
90 } 90 }
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 342
343 // Hook up a 2000x2000 display. The large resolution custom wallpaper should 343 // Hook up a 2000x2000 display. The large resolution custom wallpaper should
344 // be loaded. 344 // be loaded.
345 UpdateDisplay("800x600,2000x2000"); 345 UpdateDisplay("800x600,2000x2000");
346 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); 346 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
347 } 347 }
348 348
349 class WallpaperManagerBrowserTestNoAnimation 349 class WallpaperManagerBrowserTestNoAnimation
350 : public WallpaperManagerBrowserTest { 350 : public WallpaperManagerBrowserTest {
351 public: 351 public:
352 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 352 virtual void SetUpCommandLine(CommandLine* command_line) override {
353 command_line->AppendSwitch(switches::kLoginManager); 353 command_line->AppendSwitch(switches::kLoginManager);
354 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); 354 command_line->AppendSwitchASCII(switches::kLoginProfile, "user");
355 command_line->AppendSwitch(chromeos::switches::kDisableLoginAnimations); 355 command_line->AppendSwitch(chromeos::switches::kDisableLoginAnimations);
356 command_line->AppendSwitch(chromeos::switches::kDisableBootAnimation); 356 command_line->AppendSwitch(chromeos::switches::kDisableBootAnimation);
357 } 357 }
358 }; 358 };
359 359
360 // Same test as WallpaperManagerBrowserTest.UseMigratedWallpaperInfo. But 360 // Same test as WallpaperManagerBrowserTest.UseMigratedWallpaperInfo. But
361 // disabled boot and login animation. 361 // disabled boot and login animation.
362 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation, 362 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 UsePreMigrationWallpaperInfo) { 405 UsePreMigrationWallpaperInfo) {
406 LogIn(kTestUser1, kTestUser1Hash); 406 LogIn(kTestUser1, kTestUser1Hash);
407 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); 407 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
408 // This test should finish normally. If timeout, it is probably because chrome 408 // This test should finish normally. If timeout, it is probably because chrome
409 // can not handle pre migrated user profile (M21 profile or older). 409 // can not handle pre migrated user profile (M21 profile or older).
410 } 410 }
411 411
412 class WallpaperManagerBrowserTestCrashRestore 412 class WallpaperManagerBrowserTestCrashRestore
413 : public WallpaperManagerBrowserTest { 413 : public WallpaperManagerBrowserTest {
414 public: 414 public:
415 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 415 virtual void SetUpCommandLine(CommandLine* command_line) override {
416 command_line->AppendSwitch(chromeos::switches::kDisableLoginAnimations); 416 command_line->AppendSwitch(chromeos::switches::kDisableLoginAnimations);
417 command_line->AppendSwitch(chromeos::switches::kDisableBootAnimation); 417 command_line->AppendSwitch(chromeos::switches::kDisableBootAnimation);
418 command_line->AppendSwitchASCII(switches::kLoginUser, kTestUser1); 418 command_line->AppendSwitchASCII(switches::kLoginUser, kTestUser1);
419 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); 419 command_line->AppendSwitchASCII(switches::kLoginProfile, "user");
420 } 420 }
421 }; 421 };
422 422
423 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCrashRestore, 423 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCrashRestore,
424 PRE_RestoreWallpaper) { 424 PRE_RestoreWallpaper) {
425 LogIn(kTestUser1, kTestUser1Hash); 425 LogIn(kTestUser1, kTestUser1Hash);
426 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); 426 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
427 } 427 }
428 428
429 // Test for crbug.com/270278. It simulates a browser crash and verifies if user 429 // Test for crbug.com/270278. It simulates a browser crash and verifies if user
430 // wallpaper is loaded. 430 // wallpaper is loaded.
431 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCrashRestore, 431 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCrashRestore,
432 RestoreWallpaper) { 432 RestoreWallpaper) {
433 EXPECT_EQ(1, LoadedWallpapers()); 433 EXPECT_EQ(1, LoadedWallpapers());
434 } 434 }
435 435
436 class WallpaperManagerBrowserTestCacheUpdate 436 class WallpaperManagerBrowserTestCacheUpdate
437 : public WallpaperManagerBrowserTest { 437 : public WallpaperManagerBrowserTest {
438 public: 438 public:
439 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 439 virtual void SetUpCommandLine(CommandLine* command_line) override {
440 command_line->AppendSwitchASCII(switches::kLoginUser, kTestUser1); 440 command_line->AppendSwitchASCII(switches::kLoginUser, kTestUser1);
441 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); 441 command_line->AppendSwitchASCII(switches::kLoginProfile, "user");
442 } 442 }
443 protected: 443 protected:
444 // Creates a test image of size 1x1. 444 // Creates a test image of size 1x1.
445 gfx::ImageSkia CreateTestImage(SkColor color) { 445 gfx::ImageSkia CreateTestImage(SkColor color) {
446 return wallpaper_manager_test_utils::CreateTestImage(1, 1, color); 446 return wallpaper_manager_test_utils::CreateTestImage(1, 1, color);
447 } 447 }
448 }; 448 };
449 449
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 explicit TestObserver(WallpaperManager* wallpaper_manager) 560 explicit TestObserver(WallpaperManager* wallpaper_manager)
561 : update_wallpaper_count_(0), wallpaper_manager_(wallpaper_manager) { 561 : update_wallpaper_count_(0), wallpaper_manager_(wallpaper_manager) {
562 DCHECK(wallpaper_manager_); 562 DCHECK(wallpaper_manager_);
563 wallpaper_manager_->AddObserver(this); 563 wallpaper_manager_->AddObserver(this);
564 } 564 }
565 565
566 virtual ~TestObserver() { 566 virtual ~TestObserver() {
567 wallpaper_manager_->RemoveObserver(this); 567 wallpaper_manager_->RemoveObserver(this);
568 } 568 }
569 569
570 virtual void OnWallpaperAnimationFinished(const std::string&) OVERRIDE { 570 virtual void OnWallpaperAnimationFinished(const std::string&) override {
571 } 571 }
572 572
573 virtual void OnUpdateWallpaperForTesting() OVERRIDE { 573 virtual void OnUpdateWallpaperForTesting() override {
574 ++update_wallpaper_count_; 574 ++update_wallpaper_count_;
575 } 575 }
576 576
577 int GetUpdateWallpaperCountAndReset() { 577 int GetUpdateWallpaperCountAndReset() {
578 const size_t old = update_wallpaper_count_; 578 const size_t old = update_wallpaper_count_;
579 update_wallpaper_count_ = 0; 579 update_wallpaper_count_ = 0;
580 return old; 580 return old;
581 } 581 }
582 582
583 private: 583 private:
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 788
789 WallpaperManager::Get()->SetDefaultWallpaperNow(std::string()); 789 WallpaperManager::Get()->SetDefaultWallpaperNow(std::string());
790 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); 790 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
791 791
792 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor( 792 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
793 controller_->GetWallpaper(), 793 controller_->GetWallpaper(),
794 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor)); 794 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor));
795 } 795 }
796 796
797 } // namespace chromeos 797 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698