| Index: ash/desktop_background/desktop_background_controller_unittest.cc
|
| diff --git a/ash/desktop_background/desktop_background_controller_unittest.cc b/ash/desktop_background/desktop_background_controller_unittest.cc
|
| index 1c4810598756e008649fb3165bedc6eac567b903..294655f85f135121496a40f842ee99a7ac13c909 100644
|
| --- a/ash/desktop_background/desktop_background_controller_unittest.cc
|
| +++ b/ash/desktop_background/desktop_background_controller_unittest.cc
|
| @@ -101,10 +101,7 @@ void RunAnimationForWidget(views::Widget* widget) {
|
|
|
| class DesktopBackgroundControllerTest : public test::AshTestBase {
|
| public:
|
| - DesktopBackgroundControllerTest()
|
| - : command_line_(CommandLine::NO_PROGRAM),
|
| - controller_(NULL) {
|
| - }
|
| + DesktopBackgroundControllerTest() : controller_(NULL) {}
|
| virtual ~DesktopBackgroundControllerTest() {}
|
|
|
| virtual void SetUp() OVERRIDE {
|
| @@ -118,7 +115,7 @@ class DesktopBackgroundControllerTest : public test::AshTestBase {
|
| controller_ = Shell::GetInstance()->desktop_background_controller();
|
| wallpaper_delegate_ = static_cast<test::TestUserWallpaperDelegate*>(
|
| Shell::GetInstance()->user_wallpaper_delegate());
|
| - controller_->set_wallpaper_reload_delay_for_test(0);
|
| + controller_->set_wallpaper_reload_delay_for_test(base::TimeDelta());
|
| }
|
|
|
| protected:
|
| @@ -231,6 +228,8 @@ class DesktopBackgroundControllerTest : public test::AshTestBase {
|
| // Only needs to be called (once) by tests that want to test loading of
|
| // default wallpapers.
|
| void WriteWallpapersAndSetFlags() {
|
| + base::CommandLine cl(base::CommandLine::NO_PROGRAM);
|
| +
|
| wallpaper_dir_.reset(new base::ScopedTempDir);
|
| ASSERT_TRUE(wallpaper_dir_->CreateUniqueTempDir());
|
|
|
| @@ -238,37 +237,29 @@ class DesktopBackgroundControllerTest : public test::AshTestBase {
|
| wallpaper_dir_->path().Append(FILE_PATH_LITERAL("large.jpg"));
|
| ASSERT_TRUE(WriteJPEGFile(kLargePath, kWallpaperSize, kWallpaperSize,
|
| kLargeWallpaperColor));
|
| - command_line_.AppendSwitchPath(
|
| - switches::kAshDefaultWallpaperLarge, kLargePath);
|
| + cl.AppendSwitchPath(switches::kAshDefaultWallpaperLarge, kLargePath);
|
|
|
| const base::FilePath kSmallPath =
|
| wallpaper_dir_->path().Append(FILE_PATH_LITERAL("small.jpg"));
|
| ASSERT_TRUE(WriteJPEGFile(kSmallPath, kWallpaperSize, kWallpaperSize,
|
| kSmallWallpaperColor));
|
| - command_line_.AppendSwitchPath(
|
| - switches::kAshDefaultWallpaperSmall, kSmallPath);
|
| + cl.AppendSwitchPath(switches::kAshDefaultWallpaperSmall, kSmallPath);
|
|
|
| const base::FilePath kLargeGuestPath =
|
| wallpaper_dir_->path().Append(FILE_PATH_LITERAL("guest_large.jpg"));
|
| ASSERT_TRUE(WriteJPEGFile(kLargeGuestPath, kWallpaperSize, kWallpaperSize,
|
| kLargeGuestWallpaperColor));
|
| - command_line_.AppendSwitchPath(
|
| - switches::kAshGuestWallpaperLarge, kLargeGuestPath);
|
| + cl.AppendSwitchPath(switches::kAshGuestWallpaperLarge, kLargeGuestPath);
|
|
|
| const base::FilePath kSmallGuestPath =
|
| wallpaper_dir_->path().Append(FILE_PATH_LITERAL("guest_small.jpg"));
|
| ASSERT_TRUE(WriteJPEGFile(kSmallGuestPath, kWallpaperSize, kWallpaperSize,
|
| kSmallGuestWallpaperColor));
|
| - command_line_.AppendSwitchPath(
|
| - switches::kAshGuestWallpaperSmall, kSmallGuestPath);
|
| + cl.AppendSwitchPath(switches::kAshGuestWallpaperSmall, kSmallGuestPath);
|
|
|
| - controller_->set_command_line_for_testing(&command_line_);
|
| + controller_->InitWallpaperPathsFromCommandLine(&cl);
|
| }
|
|
|
| - // Custom command line passed to DesktopBackgroundController by
|
| - // WriteWallpapersAndSetFlags().
|
| - CommandLine command_line_;
|
| -
|
| // Directory created by WriteWallpapersAndSetFlags() to store default
|
| // wallpaper images.
|
| scoped_ptr<base::ScopedTempDir> wallpaper_dir_;
|
|
|