chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc
// If chrome tries to reload the same wallpaper twice, the latter request should
// be prevented. Otherwise, there are some strange animation issues as
// described in crbug.com/158383.
If chrome tries to reload the same wallpaper twice, the latter request should
be prevented. Otherwise, there are some strange animation issues as
described in crbug.com/158383.
If chrome tries to reload the same wallpaper twice the latter request should be prevented . Otherwise there are some strange animation issues as described in crbug . com / 158383 .
IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
                       PreventReloadingSameWallpaper) {
  WallpaperManager* wallpaper_manager = WallpaperManager::Get();
  FilePath small_wallpaper_path =
      wallpaper_manager->GetWallpaperPathForUser(UserManager::kStubUser, true);
  SaveUserWallpaperData(UserManager::kStubUser,
                        small_wallpaper_path,
                        ash::kDefaultSmallWallpaper.idr);
  WallpaperInfo info = {
      "DUMMY",
      WALLPAPER_LAYOUT_CENTER_CROPPED,
      User::CUSTOMIZED,
      base::Time::Now().LocalMidnight()
  };
  wallpaper_manager->SetUserWallpaperInfo(UserManager::kStubUser, info, true);
  wallpaper_manager->SetUserWallpaper(UserManager::kStubUser);
  EXPECT_EQ(1, LoadedWallpapers());
  wallpaper_manager->SetUserWallpaper(UserManager::kStubUser);
  EXPECT_EQ(1, LoadedWallpapers());
  WaitAsyncWallpaperLoad();
  wallpaper_manager->SetUserWallpaper(UserManager::kStubUser);
  EXPECT_EQ(1, LoadedWallpapers());
  wallpaper_manager->ClearWallpaperCache();
  info.file = "";
  info.type = User::DEFAULT;
  wallpaper_manager->SetUserWallpaperInfo(UserManager::kStubUser, info, true);
  wallpaper_manager->SetUserWallpaper(UserManager::kStubUser);
  EXPECT_EQ(2, LoadedWallpapers());
  wallpaper_manager->SetUserWallpaper(UserManager::kStubUser);
  EXPECT_EQ(2, LoadedWallpapers());
  WaitAsyncWallpaperLoad();
  wallpaper_manager->SetUserWallpaper(UserManager::kStubUser);
  EXPECT_EQ(2, LoadedWallpapers());
}
IN_PROC_BROWSER_TEST_F ( WallpaperManagerBrowserTest , PreventReloadingSameWallpaper ) { WallpaperManager * wallpaper_manager = WallpaperManager :: Get ( ) ; FilePath small_wallpaper_path = wallpaper_manager -> GetWallpaperPathForUser ( UserManager :: kStubUser , true ) ; SaveUserWallpaperData ( UserManager :: kStubUser , small_wallpaper_path , ash :: kDefaultSmallWallpaper . idr ) ; WallpaperInfo info = { " " , WALLPAPER_LAYOUT_CENTER_CROPPED , User :: CUSTOMIZED , base :: Time :: Now ( ) . LocalMidnight ( ) } ; wallpaper_manager -> SetUserWallpaperInfo ( UserManager :: kStubUser , info , true ) ; wallpaper_manager -> SetUserWallpaper ( UserManager :: kStubUser ) ; EXPECT_EQ ( 1 , LoadedWallpapers ( ) ) ; wallpaper_manager -> SetUserWallpaper ( UserManager :: kStubUser ) ; EXPECT_EQ ( 1 , LoadedWallpapers ( ) ) ; WaitAsyncWallpaperLoad ( ) ; wallpaper_manager -> SetUserWallpaper ( UserManager :: kStubUser ) ; EXPECT_EQ ( 1 , LoadedWallpapers ( ) ) ; wallpaper_manager -> ClearWallpaperCache ( ) ; info . file = " " ; info . type = User :: DEFAULT ; wallpaper_manager -> SetUserWallpaperInfo ( UserManager :: kStubUser , info , true ) ; wallpaper_manager -> SetUserWallpaper ( UserManager :: kStubUser ) ; EXPECT_EQ ( 2 , LoadedWallpapers ( ) ) ; wallpaper_manager -> SetUserWallpaper ( UserManager :: kStubUser ) ; EXPECT_EQ ( 2 , LoadedWallpapers ( ) ) ; WaitAsyncWallpaperLoad ( ) ; wallpaper_manager -> SetUserWallpaper ( UserManager :: kStubUser ) ; EXPECT_EQ ( 2 , LoadedWallpapers ( ) ) ; }
If chrome tries to reload the same wallpaper twice, the latter request should
be prevented.
If chrome tries to reload the same wallpaper twice the latter request should be prevented .
// Saves wallpaper info to local state for user |UserManager::kStubUser|. // Loads the same wallpaper before the initial one finished. It should be // prevented. // Loads the same wallpaper after the initial one finished. It should be // prevented. // Tests default wallpaper for user |UserManager::kStubUser|. // Loads the same wallpaper before the initial one finished. It should be // prevented.