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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/test/wallpaper_controller_test_api.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/wallpaper_controller_test_api.cc
diff --git a/ash/test/wallpaper_controller_test_api.cc b/ash/test/wallpaper_controller_test_api.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5cdc88b1499461c45af33281e71ea8cabe3644a8
--- /dev/null
+++ b/ash/test/wallpaper_controller_test_api.cc
@@ -0,0 +1,33 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/test/wallpaper_controller_test_api.h"
+#include "ash/wallpaper/wallpaper_controller.h"
+#include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/image/image_skia.h"
+
+namespace ash {
+namespace test {
+
+WallpaperControllerTestApi::WallpaperControllerTestApi(
+ WallpaperController* controller)
+ : controller_(controller) {}
+
+WallpaperControllerTestApi::~WallpaperControllerTestApi() {}
+
+SkColor WallpaperControllerTestApi::ApplyColorProducingWallpaper() {
+ const SkColor color = SkColorSetRGB(60, 40, 40);
+ const SkColor expected_color = SkColorSetRGB(30, 20, 20);
+
+ gfx::Canvas canvas(gfx::Size(5, 5), 1.0f, true);
+ canvas.DrawColor(color);
+ gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(canvas.GetBitmap());
+ controller_->SetWallpaperImage(image, wallpaper::WALLPAPER_LAYOUT_CENTER);
+
+ return expected_color;
+}
+
+} // namespace test
+} // namespace ash
« 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