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

Side by Side Diff: chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc

Issue 2738133003: Promotes a handful of members from WmShell to Shell (Closed)
Patch Set: merge Created 3 years, 9 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/common/wallpaper/wallpaper_controller.h" 9 #include "ash/common/wallpaper/wallpaper_controller.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/shell.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/files/scoped_temp_dir.h" 12 #include "base/files/scoped_temp_dir.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/run_loop.h" 14 #include "base/run_loop.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "chrome/browser/chromeos/customization/customization_document.h" 16 #include "chrome/browser/chromeos/customization/customization_document.h"
17 #include "chrome/browser/chromeos/customization/customization_wallpaper_download er.h" 17 #include "chrome/browser/chromeos/customization/customization_wallpaper_download er.h"
18 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" 18 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
19 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_test_u tils.h" 19 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_test_u tils.h"
20 #include "chrome/test/base/in_process_browser_test.h" 20 #include "chrome/test/base/in_process_browser_test.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 private: 243 private:
244 DISALLOW_COPY_AND_ASSIGN(CustomizationWallpaperDownloaderBrowserTest); 244 DISALLOW_COPY_AND_ASSIGN(CustomizationWallpaperDownloaderBrowserTest);
245 }; 245 };
246 246
247 IN_PROC_BROWSER_TEST_F(CustomizationWallpaperDownloaderBrowserTest, 247 IN_PROC_BROWSER_TEST_F(CustomizationWallpaperDownloaderBrowserTest,
248 OEMWallpaperIsPresent) { 248 OEMWallpaperIsPresent) {
249 CreateCmdlineWallpapers(); 249 CreateCmdlineWallpapers();
250 WallpaperManager::Get()->SetDefaultWallpaperNow(EmptyAccountId()); 250 WallpaperManager::Get()->SetDefaultWallpaperNow(EmptyAccountId());
251 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); 251 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
252 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor( 252 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
253 ash::WmShell::Get()->wallpaper_controller()->GetWallpaper(), 253 ash::Shell::GetInstance()->wallpaper_controller()->GetWallpaper(),
254 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor)); 254 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor));
255 255
256 WallpaperImageFetcherFactory url_factory( 256 WallpaperImageFetcherFactory url_factory(
257 GURL(kOEMWallpaperURL), 257 GURL(kOEMWallpaperURL),
258 wallpaper_manager_test_utils::kWallpaperSize, 258 wallpaper_manager_test_utils::kWallpaperSize,
259 wallpaper_manager_test_utils::kWallpaperSize, 259 wallpaper_manager_test_utils::kWallpaperSize,
260 wallpaper_manager_test_utils::kCustomWallpaperColor, 260 wallpaper_manager_test_utils::kCustomWallpaperColor,
261 0 /* require_retries */); 261 0 /* require_retries */);
262 262
263 TestWallpaperObserver observer(WallpaperManager::Get()); 263 TestWallpaperObserver observer(WallpaperManager::Get());
264 chromeos::ServicesCustomizationDocument* customization = 264 chromeos::ServicesCustomizationDocument* customization =
265 chromeos::ServicesCustomizationDocument::GetInstance(); 265 chromeos::ServicesCustomizationDocument::GetInstance();
266 EXPECT_TRUE( 266 EXPECT_TRUE(
267 customization->LoadManifestFromString(std::string(kServicesManifest))); 267 customization->LoadManifestFromString(std::string(kServicesManifest)));
268 268
269 observer.WaitForWallpaperAnimationFinished(); 269 observer.WaitForWallpaperAnimationFinished();
270 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor( 270 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
271 ash::WmShell::Get()->wallpaper_controller()->GetWallpaper(), 271 ash::Shell::GetInstance()->wallpaper_controller()->GetWallpaper(),
272 wallpaper_manager_test_utils::kCustomWallpaperColor)); 272 wallpaper_manager_test_utils::kCustomWallpaperColor));
273 EXPECT_EQ(1U, url_factory.num_attempts()); 273 EXPECT_EQ(1U, url_factory.num_attempts());
274 } 274 }
275 275
276 IN_PROC_BROWSER_TEST_F(CustomizationWallpaperDownloaderBrowserTest, 276 IN_PROC_BROWSER_TEST_F(CustomizationWallpaperDownloaderBrowserTest,
277 OEMWallpaperRetryFetch) { 277 OEMWallpaperRetryFetch) {
278 CreateCmdlineWallpapers(); 278 CreateCmdlineWallpapers();
279 WallpaperManager::Get()->SetDefaultWallpaperNow(EmptyAccountId()); 279 WallpaperManager::Get()->SetDefaultWallpaperNow(EmptyAccountId());
280 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); 280 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
281 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor( 281 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
282 ash::WmShell::Get()->wallpaper_controller()->GetWallpaper(), 282 ash::Shell::GetInstance()->wallpaper_controller()->GetWallpaper(),
283 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor)); 283 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor));
284 284
285 WallpaperImageFetcherFactory url_factory( 285 WallpaperImageFetcherFactory url_factory(
286 GURL(kOEMWallpaperURL), 286 GURL(kOEMWallpaperURL),
287 wallpaper_manager_test_utils::kWallpaperSize, 287 wallpaper_manager_test_utils::kWallpaperSize,
288 wallpaper_manager_test_utils::kWallpaperSize, 288 wallpaper_manager_test_utils::kWallpaperSize,
289 wallpaper_manager_test_utils::kCustomWallpaperColor, 289 wallpaper_manager_test_utils::kCustomWallpaperColor,
290 1 /* require_retries */); 290 1 /* require_retries */);
291 291
292 TestWallpaperObserver observer(WallpaperManager::Get()); 292 TestWallpaperObserver observer(WallpaperManager::Get());
293 chromeos::ServicesCustomizationDocument* customization = 293 chromeos::ServicesCustomizationDocument* customization =
294 chromeos::ServicesCustomizationDocument::GetInstance(); 294 chromeos::ServicesCustomizationDocument::GetInstance();
295 EXPECT_TRUE( 295 EXPECT_TRUE(
296 customization->LoadManifestFromString(std::string(kServicesManifest))); 296 customization->LoadManifestFromString(std::string(kServicesManifest)));
297 297
298 observer.WaitForWallpaperAnimationFinished(); 298 observer.WaitForWallpaperAnimationFinished();
299 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor( 299 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
300 ash::WmShell::Get()->wallpaper_controller()->GetWallpaper(), 300 ash::Shell::GetInstance()->wallpaper_controller()->GetWallpaper(),
301 wallpaper_manager_test_utils::kCustomWallpaperColor)); 301 wallpaper_manager_test_utils::kCustomWallpaperColor));
302 302
303 EXPECT_EQ(2U, url_factory.num_attempts()); 303 EXPECT_EQ(2U, url_factory.num_attempts());
304 } 304 }
305 305
306 } // namespace chromeos 306 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.cc ('k') | chrome/browser/chromeos/login/kiosk_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698