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

Unified Diff: chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc

Issue 1483083003: Set the window state consistently Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/window_util_unittest.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc
diff --git a/chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc b/chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc
index a29488357952d6c0309e03ecb6b5a98acd976e14..b5a5d891146a4cf91fe99b9c5c7bdefbaefbc89f 100644
--- a/chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc
+++ b/chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc
@@ -77,6 +77,11 @@ class TestWallpaperObserver : public WallpaperManager::Observer {
base::RunLoop().Run();
}
+ static void WaitForWallpaperAnimated() {
+ TestWallpaperObserver observer(WallpaperManager::Get());
+ observer.WaitForWallpaperAnimationFinished();
+ }
+
private:
bool finished_;
WallpaperManager* wallpaper_manager_;
@@ -260,8 +265,10 @@ class CustomizationWallpaperDownloaderBrowserTest
IN_PROC_BROWSER_TEST_F(CustomizationWallpaperDownloaderBrowserTest,
OEMWallpaperIsPresent) {
CreateCmdlineWallpapers();
+ TestWallpaperObserver::WaitForWallpaperAnimated();
+
WallpaperManager::Get()->SetDefaultWallpaperNow(std::string());
- wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
+ TestWallpaperObserver::WaitForWallpaperAnimated();
EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
controller_->GetWallpaper(),
wallpaper_manager_test_utils::kSmallDefaultWallpaperColor));
@@ -289,8 +296,11 @@ IN_PROC_BROWSER_TEST_F(CustomizationWallpaperDownloaderBrowserTest,
IN_PROC_BROWSER_TEST_F(CustomizationWallpaperDownloaderBrowserTest,
OEMWallpaperRetryFetch) {
CreateCmdlineWallpapers();
+ TestWallpaperObserver::WaitForWallpaperAnimated();
+
+ TestWallpaperObserver observer2(WallpaperManager::Get());
WallpaperManager::Get()->SetDefaultWallpaperNow(std::string());
- wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
+ TestWallpaperObserver::WaitForWallpaperAnimated();
EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
controller_->GetWallpaper(),
wallpaper_manager_test_utils::kSmallDefaultWallpaperColor));
@@ -302,13 +312,12 @@ IN_PROC_BROWSER_TEST_F(CustomizationWallpaperDownloaderBrowserTest,
wallpaper_manager_test_utils::kCustomWallpaperColor,
1 /* require_retries */);
- TestWallpaperObserver observer(WallpaperManager::Get());
chromeos::ServicesCustomizationDocument* customization =
chromeos::ServicesCustomizationDocument::GetInstance();
EXPECT_TRUE(
customization->LoadManifestFromString(std::string(kServicesManifest)));
- observer.WaitForWallpaperAnimationFinished();
+ TestWallpaperObserver::WaitForWallpaperAnimated();
EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
controller_->GetWallpaper(),
wallpaper_manager_test_utils::kCustomWallpaperColor));
« no previous file with comments | « ash/wm/window_util_unittest.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698