chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc
// This test is similar to LoadLargeWallpaperForExternalScreen test. Instead of
// testing default wallpaper, it tests custom wallpaper.
This test is similar to LoadLargeWallpaperForExternalScreen test. Instead of
testing default wallpaper, it tests custom wallpaper.
This test is similar to LoadLargeWallpaperForExternalScreen test . Instead of testing default wallpaper it tests custom wallpaper .
IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
                       LoadCustomLargeWallpaperForLargeExternalScreen) {
  WallpaperManager* wallpaper_manager = WallpaperManager::Get();
  FilePath small_wallpaper_path =
      wallpaper_manager->GetWallpaperPathForUser(UserManager::kStubUser, true);
  FilePath large_wallpaper_path =
      wallpaper_manager->GetWallpaperPathForUser(UserManager::kStubUser, false);
  SaveUserWallpaperData(UserManager::kStubUser,
                        small_wallpaper_path,
                        ash::kDefaultSmallWallpaper.idr);
  SaveUserWallpaperData(UserManager::kStubUser,
                        large_wallpaper_path,
                        ash::kDefaultLargeWallpaper.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);
  WaitAsyncWallpaperLoad();
  gfx::ImageSkia wallpaper = controller_->GetWallpaper();
  EXPECT_EQ(kExpectedSmallWallpaperWidth, wallpaper.width());
  EXPECT_EQ(kExpectedSmallWallpaperHeight, wallpaper.height());
  UpdateDisplay("800x600,800x600");
  EXPECT_EQ(kExpectedSmallWallpaperWidth, wallpaper.width());
  EXPECT_EQ(kExpectedSmallWallpaperHeight, wallpaper.height());
  UpdateDisplay("800x600");
  UpdateDisplay("800x600,2000x2000");
  WaitAsyncWallpaperLoad();
  wallpaper = controller_->GetWallpaper();
  EXPECT_EQ(kExpectedLargeWallpaperWidth, wallpaper.width());
  EXPECT_EQ(kExpectedLargeWallpaperHeight, wallpaper.height());
  UpdateDisplay("800x600");
  UpdateDisplay("800x600,2000x2000");
  WaitAsyncWallpaperLoad();
  wallpaper = controller_->GetWallpaper();
  EXPECT_EQ(kExpectedLargeWallpaperWidth, wallpaper.width());
  EXPECT_EQ(kExpectedLargeWallpaperHeight, wallpaper.height());
}
IN_PROC_BROWSER_TEST_F ( WallpaperManagerBrowserTest , LoadCustomLargeWallpaperForLargeExternalScreen ) { WallpaperManager * wallpaper_manager = WallpaperManager :: Get ( ) ; FilePath small_wallpaper_path = wallpaper_manager -> GetWallpaperPathForUser ( UserManager :: kStubUser , true ) ; FilePath large_wallpaper_path = wallpaper_manager -> GetWallpaperPathForUser ( UserManager :: kStubUser , false ) ; SaveUserWallpaperData ( UserManager :: kStubUser , small_wallpaper_path , ash :: kDefaultSmallWallpaper . idr ) ; SaveUserWallpaperData ( UserManager :: kStubUser , large_wallpaper_path , ash :: kDefaultLargeWallpaper . 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 ) ; WaitAsyncWallpaperLoad ( ) ; gfx :: ImageSkia wallpaper = controller_ -> GetWallpaper ( ) ; EXPECT_EQ ( kExpectedSmallWallpaperWidth , wallpaper . width ( ) ) ; EXPECT_EQ ( kExpectedSmallWallpaperHeight , wallpaper . height ( ) ) ; UpdateDisplay ( " " ) ; EXPECT_EQ ( kExpectedSmallWallpaperWidth , wallpaper . width ( ) ) ; EXPECT_EQ ( kExpectedSmallWallpaperHeight , wallpaper . height ( ) ) ; UpdateDisplay ( " " ) ; UpdateDisplay ( " " ) ; WaitAsyncWallpaperLoad ( ) ; wallpaper = controller_ -> GetWallpaper ( ) ; EXPECT_EQ ( kExpectedLargeWallpaperWidth , wallpaper . width ( ) ) ; EXPECT_EQ ( kExpectedLargeWallpaperHeight , wallpaper . height ( ) ) ; UpdateDisplay ( " " ) ; UpdateDisplay ( " " ) ; WaitAsyncWallpaperLoad ( ) ; wallpaper = controller_ -> GetWallpaper ( ) ; EXPECT_EQ ( kExpectedLargeWallpaperWidth , wallpaper . width ( ) ) ; EXPECT_EQ ( kExpectedLargeWallpaperHeight , wallpaper . height ( ) ) ; }
This test is similar to LoadLargeWallpaperForExternalScreen test.
This test is similar to LoadLargeWallpaperForExternalScreen test .
// Saves the small/large resolution wallpapers to small/large custom // wallpaper paths. // Saves wallpaper info to local state for user |UserManager::kStubUser|. // Set the wallpaper for |UserManager::kStubUser|. // Display is initialized to 800x600. The small resolution custom wallpaper is // expected. // Hook up another 800x600 display. // The small resolution custom wallpaper is expected. // Detach the secondary display. // Hook up a 2000x2000 display. The large resolution custom wallpaper should // be loaded. // The large resolution custom wallpaper is expected. // Detach the secondary display. // Hook up the 2000x2000 display again. The large resolution default wallpaper // should persist. Test for crbug/165788. // The large resolution custom wallpaper is expected.