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

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

Issue 2200893002: mash: Partially migrate ash/desktop_background to ash common types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mash browser test crash in GetMaxDisplaySizeInNative. Created 4 years, 4 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
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/desktop_background/desktop_background_controller_test_api.h"
13 #include "ash/display/display_manager.h" 12 #include "ash/display/display_manager.h"
14 #include "ash/shell.h" 13 #include "ash/shell.h"
15 #include "ash/test/ash_test_base.h" 14 #include "ash/test/ash_test_base.h"
16 #include "ash/test/ash_test_helper.h" 15 #include "ash/test/ash_test_helper.h"
17 #include "ash/test/display_manager_test_api.h" 16 #include "ash/test/display_manager_test_api.h"
18 #include "ash/test/test_user_wallpaper_delegate.h"
19 #include "base/command_line.h" 17 #include "base/command_line.h"
20 #include "base/compiler_specific.h" 18 #include "base/compiler_specific.h"
21 #include "base/files/file_path.h" 19 #include "base/files/file_path.h"
22 #include "base/files/file_util.h" 20 #include "base/files/file_util.h"
23 #include "base/macros.h" 21 #include "base/macros.h"
24 #include "base/message_loop/message_loop.h" 22 #include "base/message_loop/message_loop.h"
25 #include "base/path_service.h" 23 #include "base/path_service.h"
26 #include "base/strings/string_number_conversions.h" 24 #include "base/strings/string_number_conversions.h"
27 #include "base/time/time.h" 25 #include "base/time/time.h"
28 #include "base/values.h" 26 #include "base/values.h"
29 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_test_u tils.h" 27 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_test_u tils.h"
30 #include "chrome/common/chrome_paths.h" 28 #include "chrome/common/chrome_paths.h"
31 #include "chrome/test/base/in_process_browser_test.h" 29 #include "chrome/test/base/in_process_browser_test.h"
32 #include "chrome/test/base/testing_browser_process.h" 30 #include "chrome/test/base/testing_browser_process.h"
33 #include "chromeos/chromeos_switches.h" 31 #include "chromeos/chromeos_switches.h"
34 #include "chromeos/login/user_names.h" 32 #include "chromeos/login/user_names.h"
35 #include "components/prefs/scoped_user_pref_update.h" 33 #include "components/prefs/scoped_user_pref_update.h"
36 #include "components/signin/core/account_id/account_id.h" 34 #include "components/signin/core/account_id/account_id.h"
37 #include "components/user_manager/user.h" 35 #include "components/user_manager/user.h"
38 #include "components/user_manager/user_manager.h" 36 #include "components/user_manager/user_manager.h"
39 #include "components/wallpaper/wallpaper_files_id.h" 37 #include "components/wallpaper/wallpaper_files_id.h"
40 #include "content/public/test/test_utils.h" 38 #include "content/public/test/test_utils.h"
41 #include "ui/aura/env.h" 39 #include "ui/aura/env.h"
42 #include "ui/gfx/geometry/point.h" 40 #include "ui/gfx/geometry/point.h"
43 #include "ui/gfx/geometry/rect.h" 41 #include "ui/gfx/geometry/rect.h"
44 #include "ui/gfx/image/image_skia.h" 42 #include "ui/gfx/image/image_skia.h"
45 43
46 using wallpaper::WallpaperLayout;
47 using wallpaper::WallpaperInfo; 44 using wallpaper::WallpaperInfo;
48 using wallpaper::WALLPAPER_LAYOUT_CENTER; 45 using wallpaper::WALLPAPER_LAYOUT_CENTER;
49 using wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED; 46 using wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED;
50 using wallpaper::WALLPAPER_LAYOUT_STRETCH; 47 using wallpaper::WALLPAPER_LAYOUT_STRETCH;
51 using wallpaper::WALLPAPER_LAYOUT_TILE; 48 using wallpaper::WALLPAPER_LAYOUT_TILE;
52 49
53 namespace chromeos { 50 namespace chromeos {
54 51
55 namespace { 52 namespace {
56 53
(...skipping 12 matching lines...) Expand all
69 class WallpaperManagerBrowserTest : public InProcessBrowserTest { 66 class WallpaperManagerBrowserTest : public InProcessBrowserTest {
70 public: 67 public:
71 WallpaperManagerBrowserTest() : controller_(NULL), 68 WallpaperManagerBrowserTest() : controller_(NULL),
72 local_state_(NULL) { 69 local_state_(NULL) {
73 } 70 }
74 71
75 ~WallpaperManagerBrowserTest() override {} 72 ~WallpaperManagerBrowserTest() override {}
76 73
77 void SetUpOnMainThread() override { 74 void SetUpOnMainThread() override {
78 controller_ = ash::Shell::GetInstance()->desktop_background_controller(); 75 controller_ = ash::Shell::GetInstance()->desktop_background_controller();
76 controller_->set_wallpaper_reload_delay_for_test(0);
79 local_state_ = g_browser_process->local_state(); 77 local_state_ = g_browser_process->local_state();
80 ash::DesktopBackgroundController::TestAPI(controller_)
81 .set_wallpaper_reload_delay_for_test(0);
82 UpdateDisplay("800x600"); 78 UpdateDisplay("800x600");
83 } 79 }
84 80
85 void SetUpCommandLine(base::CommandLine* command_line) override { 81 void SetUpCommandLine(base::CommandLine* command_line) override {
86 command_line->AppendSwitch(switches::kLoginManager); 82 command_line->AppendSwitch(switches::kLoginManager);
87 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); 83 command_line->AppendSwitchASCII(switches::kLoginProfile, "user");
88 } 84 }
89 85
90 void TearDownOnMainThread() override { controller_ = NULL; } 86 void TearDownOnMainThread() override { controller_ = NULL; }
91 87
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 858
863 WallpaperManager::Get()->SetDefaultWallpaperNow(EmptyAccountId()); 859 WallpaperManager::Get()->SetDefaultWallpaperNow(EmptyAccountId());
864 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); 860 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
865 861
866 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor( 862 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
867 controller_->GetWallpaper(), 863 controller_->GetWallpaper(),
868 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor)); 864 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor));
869 } 865 }
870 866
871 } // namespace chromeos 867 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698