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

Side by Side Diff: ash/test/wallpaper_controller_test_api.cc

Issue 2867413002: [ash-md] Updated the overflow shelf to change colors based on the wallpaper. (Closed)
Patch Set: Added ShelfViewTest.OverflowShelfColorIsDerivedFromWallpaper test. Created 3 years, 7 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
« no previous file with comments | « ash/test/wallpaper_controller_test_api.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/test/wallpaper_controller_test_api.h"
6 #include "ash/wallpaper/wallpaper_controller.h"
7 #include "ui/gfx/canvas.h"
8 #include "ui/gfx/geometry/size.h"
9 #include "ui/gfx/image/image_skia.h"
10
11 namespace ash {
12 namespace test {
13
14 WallpaperControllerTestApi::WallpaperControllerTestApi(
15 WallpaperController* controller)
16 : controller_(controller) {}
17
18 WallpaperControllerTestApi::~WallpaperControllerTestApi() {}
19
20 SkColor WallpaperControllerTestApi::ApplyColorProducingWallpaper() {
21 const SkColor color = SkColorSetRGB(60, 40, 40);
22 const SkColor expected_color = SkColorSetRGB(30, 20, 20);
23
24 gfx::Canvas canvas(gfx::Size(5, 5), 1.0f, true);
25 canvas.DrawColor(color);
26 gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(canvas.GetBitmap());
27 controller_->SetWallpaperImage(image, wallpaper::WALLPAPER_LAYOUT_CENTER);
28
29 return expected_color;
30 }
31
32 } // namespace test
33 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/wallpaper_controller_test_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698