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

Unified Diff: ash/frame/default_header_painter_unittest.cc

Issue 934503002: Ash frames: dark frames now use white caption buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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/frame/default_header_painter.cc ('k') | ash/resources/ash_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/frame/default_header_painter_unittest.cc
diff --git a/ash/frame/default_header_painter_unittest.cc b/ash/frame/default_header_painter_unittest.cc
index c4e2106980998215952392b0c7a94e562ec37c4a..0bf03ebc88af174b66b8416eb75402738faca9b0 100644
--- a/ash/frame/default_header_painter_unittest.cc
+++ b/ash/frame/default_header_painter_unittest.cc
@@ -53,4 +53,45 @@ TEST_F(DefaultHeaderPainterTest, TitleIconAlignment) {
title_bounds.CenterPoint().y());
}
+// Ensure the light icons are used when appropriate.
+TEST_F(DefaultHeaderPainterTest, LightIcons) {
+ scoped_ptr<Widget> w(CreateTestWidget());
+ ash::FrameCaptionButtonContainerView container(w.get());
+ views::StaticSizedView window_icon(gfx::Size(16, 16));
+ window_icon.SetBounds(0, 0, 16, 16);
+ w->SetBounds(gfx::Rect(0, 0, 500, 500));
+ w->Show();
+
+ DefaultHeaderPainter painter;
+ painter.Init(w.get(), w->non_client_view()->frame_view(), &container);
+
+ // Check by default light icons are not used.
+ painter.mode_ = HeaderPainter::MODE_ACTIVE;
+ EXPECT_EQ(false, painter.ShouldUseLightImages());
+ painter.mode_ = HeaderPainter::MODE_INACTIVE;
+ EXPECT_EQ(false, painter.ShouldUseLightImages());
+
+ // Check that setting dark colors should use light icons.
+ painter.SetFrameColors(SkColorSetRGB(0, 0, 0), SkColorSetRGB(0, 0, 0));
+ painter.mode_ = HeaderPainter::MODE_ACTIVE;
+ EXPECT_EQ(true, painter.ShouldUseLightImages());
+ painter.mode_ = HeaderPainter::MODE_INACTIVE;
+ EXPECT_EQ(true, painter.ShouldUseLightImages());
+
+ // Check that inactive and active colors are used properly.
+ painter.SetFrameColors(SkColorSetRGB(0, 0, 0), SkColorSetRGB(255, 255, 255));
+ painter.mode_ = HeaderPainter::MODE_ACTIVE;
+ EXPECT_EQ(true, painter.ShouldUseLightImages());
+ painter.mode_ = HeaderPainter::MODE_INACTIVE;
+ EXPECT_EQ(false, painter.ShouldUseLightImages());
+
+ // Check not so light or dark colors.
+ painter.SetFrameColors(SkColorSetRGB(70, 70, 70),
+ SkColorSetRGB(200, 200, 200));
+ painter.mode_ = HeaderPainter::MODE_ACTIVE;
+ EXPECT_EQ(true, painter.ShouldUseLightImages());
+ painter.mode_ = HeaderPainter::MODE_INACTIVE;
+ EXPECT_EQ(false, painter.ShouldUseLightImages());
+}
+
} // namespace ash
« no previous file with comments | « ash/frame/default_header_painter.cc ('k') | ash/resources/ash_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698