| Index: chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc
|
| diff --git a/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc b/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc
|
| index ae17295deaa9e243c086d574630f1f5a915b69df..e92a05a795a5ad94b8e4bc7ec27272a12592fda4 100644
|
| --- a/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc
|
| +++ b/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc
|
| @@ -53,7 +53,8 @@ const char kTestUser2Hash[] = "test2@domain.com-hash";
|
| } // namespace
|
|
|
| class WallpaperManagerBrowserTest : public InProcessBrowserTest,
|
| - public DesktopBackgroundControllerObserver {
|
| + public DesktopBackgroundControllerObserver,
|
| + public testing::WithParamInterface<bool> {
|
| public:
|
| WallpaperManagerBrowserTest () : controller_(NULL),
|
| local_state_(NULL) {
|
| @@ -71,6 +72,8 @@ class WallpaperManagerBrowserTest : public InProcessBrowserTest,
|
| virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
|
| command_line->AppendSwitch(switches::kLoginManager);
|
| command_line->AppendSwitchASCII(switches::kLoginProfile, "user");
|
| + if (GetParam())
|
| + command_line->AppendSwitch(::switches::kMultiProfiles);
|
| }
|
|
|
| virtual void CleanUpOnMainThread() OVERRIDE {
|
| @@ -150,7 +153,7 @@ class WallpaperManagerBrowserTest : public InProcessBrowserTest,
|
|
|
| // Tests that the appropriate custom wallpaper (large vs. small) is loaded
|
| // depending on the desktop resolution.
|
| -IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTest,
|
| LoadCustomLargeWallpaperForLargeExternalScreen) {
|
| WallpaperManager* wallpaper_manager = WallpaperManager::Get();
|
| LogIn(kTestUser1, kTestUser1Hash);
|
| @@ -226,7 +229,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
|
| // 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,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTest,
|
| PreventReloadingSameWallpaper) {
|
| WallpaperManager* wallpaper_manager = WallpaperManager::Get();
|
| // New user log in, a default wallpaper is loaded.
|
| @@ -242,7 +245,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
|
| wallpaper_manager->SetUserWallpaperNow(kTestUser1);
|
| WaitAsyncWallpaperLoadFinished();
|
| EXPECT_EQ(1, LoadedWallpapers());
|
| - wallpaper_manager->ClearWallpaperCache();
|
| + wallpaper_manager->ClearDisposableWallpaperCache();
|
|
|
| // Change wallpaper to a custom wallpaper.
|
| std::string id = base::Int64ToString(base::Time::Now().ToInternalValue());
|
| @@ -280,7 +283,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
|
| // lagacy wallpapers should migrate to new wallpaper picker version seamlessly.
|
| // This tests make sure we compatible with migrated old wallpapers.
|
| // crosbug.com/38429
|
| -IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTest,
|
| PRE_UseMigratedWallpaperInfo) {
|
| // New user log in, a default wallpaper is loaded.
|
| LogIn(kTestUser1, kTestUser1Hash);
|
| @@ -300,7 +303,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
|
| WallpaperManager::Get()->SetUserWallpaperInfo(kTestUser1, info, true);
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTest,
|
| UseMigratedWallpaperInfo) {
|
| LogIn(kTestUser1, kTestUser1Hash);
|
| WaitAsyncWallpaperLoadFinished();
|
| @@ -311,7 +314,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
|
|
|
| // Some users have old user profiles which may never get a chance to migrate.
|
| // This tests make sure we compatible with these profiles.
|
| -IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTest,
|
| PRE_UsePreMigrationWallpaperInfo) {
|
| // New user log in, a default wallpaper is loaded.
|
| LogIn(kTestUser1, kTestUser1Hash);
|
| @@ -321,7 +324,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
|
| WallpaperManager::Get()->RemoveUserWallpaperInfo(kTestUser1);
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTest,
|
| UsePreMigrationWallpaperInfo) {
|
| LogIn(kTestUser1, kTestUser1Hash);
|
| WaitAsyncWallpaperLoadFinished();
|
| @@ -331,7 +334,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
|
|
|
| // Test for http://crbug.com/265689. When hooked up a large external monitor,
|
| // the default large resolution wallpaper should load.
|
| -IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTest,
|
| HotPlugInScreenAtGAIALoginScreen) {
|
| UpdateDisplay("800x600");
|
| // Set initial wallpaper to the default wallpaper.
|
| @@ -357,7 +360,7 @@ class WallpaperManagerBrowserTestNoAnimation
|
|
|
| // Same test as WallpaperManagerBrowserTest.UseMigratedWallpaperInfo. But
|
| // disabled boot and login animation.
|
| -IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTestNoAnimation,
|
| PRE_UseMigratedWallpaperInfo) {
|
| // New user log in, a default wallpaper is loaded.
|
| LogIn(kTestUser1, kTestUser1Hash);
|
| @@ -377,7 +380,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation,
|
| WallpaperManager::Get()->SetUserWallpaperInfo(kTestUser1, info, true);
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTestNoAnimation,
|
| UseMigratedWallpaperInfo) {
|
| LogIn(kTestUser1, kTestUser1Hash);
|
| WaitAsyncWallpaperLoadFinished();
|
| @@ -388,7 +391,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation,
|
|
|
| // Same test as WallpaperManagerBrowserTest.UsePreMigrationWallpaperInfo. But
|
| // disabled boot and login animation.
|
| -IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTestNoAnimation,
|
| PRE_UsePreMigrationWallpaperInfo) {
|
| // New user log in, a default wallpaper is loaded.
|
| LogIn(kTestUser1, kTestUser1Hash);
|
| @@ -399,7 +402,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation,
|
| WallpaperManager::Get()->RemoveUserWallpaperInfo(kTestUser1);
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTestNoAnimation,
|
| UsePreMigrationWallpaperInfo) {
|
| LogIn(kTestUser1, kTestUser1Hash);
|
| WaitAsyncWallpaperLoadFinished();
|
| @@ -420,7 +423,7 @@ class WallpaperManagerBrowserTestCrashRestore
|
| }
|
| };
|
|
|
| -IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCrashRestore,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTestCrashRestore,
|
| PRE_RestoreWallpaper) {
|
| LogIn(kTestUser1, kTestUser1Hash);
|
| WaitAsyncWallpaperLoadFinished();
|
| @@ -428,7 +431,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCrashRestore,
|
|
|
| // Test for crbug.com/270278. It simulates a browser crash and verifies if user
|
| // wallpaper is loaded.
|
| -IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCrashRestore,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTestCrashRestore,
|
| RestoreWallpaper) {
|
| EXPECT_EQ(1, LoadedWallpapers());
|
| }
|
| @@ -454,7 +457,7 @@ class WallpaperManagerBrowserTestCacheUpdate
|
| };
|
|
|
| // Sets kTestUser1's wallpaper to a custom wallpaper.
|
| -IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCacheUpdate,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTestCacheUpdate,
|
| PRE_VerifyWallpaperCache) {
|
| // Add kTestUser1 to user list. kTestUser1 is the default login profile.
|
| LogIn(kTestUser1, kTestUser1Hash);
|
| @@ -504,7 +507,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCacheUpdate,
|
| // 3. reverts to a default wallpaper.
|
| // Also, when user login at multi-profile mode, previous logged in users'
|
| // wallpaper cache should not be deleted.
|
| -IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCacheUpdate,
|
| +IN_PROC_BROWSER_TEST_P(WallpaperManagerBrowserTestCacheUpdate,
|
| VerifyWallpaperCache) {
|
| WaitAsyncWallpaperLoadFinished();
|
| WallpaperManager* wallpaper_manager = WallpaperManager::Get();
|
| @@ -552,4 +555,20 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCacheUpdate,
|
| EXPECT_FALSE(test_api->GetWallpaperFromCache(kTestUser1, &cached_wallpaper));
|
| }
|
|
|
| +INSTANTIATE_TEST_CASE_P(WallpaperManagerBrowserTestInstantiation,
|
| + WallpaperManagerBrowserTest,
|
| + testing::Bool());
|
| +
|
| +INSTANTIATE_TEST_CASE_P(WallpaperManagerBrowserTestNoAnimationInstantiation,
|
| + WallpaperManagerBrowserTestNoAnimation,
|
| + testing::Bool());
|
| +
|
| +INSTANTIATE_TEST_CASE_P(WallpaperManagerBrowserTestCrashRestoreInstantiation,
|
| + WallpaperManagerBrowserTestCrashRestore,
|
| + testing::Bool());
|
| +
|
| +INSTANTIATE_TEST_CASE_P(WallpaperManagerBrowserTestCacheUpdateInstantiation,
|
| + WallpaperManagerBrowserTestCacheUpdate,
|
| + testing::Bool());
|
| +
|
| } // namespace chromeos
|
|
|