OLD | NEW |
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 "ash/frame/default_header_painter.h" | 5 #include "ash/frame/default_header_painter.h" |
6 | 6 |
7 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 7 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
10 #include "ash/wm/window_state.h" | 10 #include "ash/wm/window_state.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 views::StaticSizedView window_icon(gfx::Size(16, 16)); | 60 views::StaticSizedView window_icon(gfx::Size(16, 16)); |
61 window_icon.SetBounds(0, 0, 16, 16); | 61 window_icon.SetBounds(0, 0, 16, 16); |
62 w->SetBounds(gfx::Rect(0, 0, 500, 500)); | 62 w->SetBounds(gfx::Rect(0, 0, 500, 500)); |
63 w->Show(); | 63 w->Show(); |
64 | 64 |
65 DefaultHeaderPainter painter; | 65 DefaultHeaderPainter painter; |
66 painter.Init(w.get(), w->non_client_view()->frame_view(), &container); | 66 painter.Init(w.get(), w->non_client_view()->frame_view(), &container); |
67 | 67 |
68 // Check by default light icons are not used. | 68 // Check by default light icons are not used. |
69 painter.mode_ = HeaderPainter::MODE_ACTIVE; | 69 painter.mode_ = HeaderPainter::MODE_ACTIVE; |
70 EXPECT_EQ(false, painter.ShouldUseLightImages()); | 70 EXPECT_FALSE(painter.ShouldUseLightImages()); |
71 painter.mode_ = HeaderPainter::MODE_INACTIVE; | 71 painter.mode_ = HeaderPainter::MODE_INACTIVE; |
72 EXPECT_EQ(false, painter.ShouldUseLightImages()); | 72 EXPECT_FALSE(painter.ShouldUseLightImages()); |
73 | 73 |
74 // Check that setting dark colors should use light icons. | 74 // Check that setting dark colors should use light icons. |
75 painter.SetFrameColors(SkColorSetRGB(0, 0, 0), SkColorSetRGB(0, 0, 0)); | 75 painter.SetFrameColors(SkColorSetRGB(0, 0, 0), SkColorSetRGB(0, 0, 0)); |
76 painter.mode_ = HeaderPainter::MODE_ACTIVE; | 76 painter.mode_ = HeaderPainter::MODE_ACTIVE; |
77 EXPECT_EQ(true, painter.ShouldUseLightImages()); | 77 EXPECT_TRUE(painter.ShouldUseLightImages()); |
78 painter.mode_ = HeaderPainter::MODE_INACTIVE; | 78 painter.mode_ = HeaderPainter::MODE_INACTIVE; |
79 EXPECT_EQ(true, painter.ShouldUseLightImages()); | 79 EXPECT_TRUE(painter.ShouldUseLightImages()); |
80 | 80 |
81 // Check that inactive and active colors are used properly. | 81 // Check that inactive and active colors are used properly. |
82 painter.SetFrameColors(SkColorSetRGB(0, 0, 0), SkColorSetRGB(255, 255, 255)); | 82 painter.SetFrameColors(SkColorSetRGB(0, 0, 0), SkColorSetRGB(255, 255, 255)); |
83 painter.mode_ = HeaderPainter::MODE_ACTIVE; | 83 painter.mode_ = HeaderPainter::MODE_ACTIVE; |
84 EXPECT_EQ(true, painter.ShouldUseLightImages()); | 84 EXPECT_TRUE(painter.ShouldUseLightImages()); |
85 painter.mode_ = HeaderPainter::MODE_INACTIVE; | 85 painter.mode_ = HeaderPainter::MODE_INACTIVE; |
86 EXPECT_EQ(false, painter.ShouldUseLightImages()); | 86 EXPECT_FALSE(painter.ShouldUseLightImages()); |
87 | 87 |
88 // Check not so light or dark colors. | 88 // Check not so light or dark colors. |
89 painter.SetFrameColors(SkColorSetRGB(70, 70, 70), | 89 painter.SetFrameColors(SkColorSetRGB(70, 70, 70), |
90 SkColorSetRGB(200, 200, 200)); | 90 SkColorSetRGB(200, 200, 200)); |
91 painter.mode_ = HeaderPainter::MODE_ACTIVE; | 91 painter.mode_ = HeaderPainter::MODE_ACTIVE; |
92 EXPECT_EQ(true, painter.ShouldUseLightImages()); | 92 EXPECT_TRUE(painter.ShouldUseLightImages()); |
93 painter.mode_ = HeaderPainter::MODE_INACTIVE; | 93 painter.mode_ = HeaderPainter::MODE_INACTIVE; |
94 EXPECT_EQ(false, painter.ShouldUseLightImages()); | 94 EXPECT_FALSE(painter.ShouldUseLightImages()); |
95 } | 95 } |
96 | 96 |
97 } // namespace ash | 97 } // namespace ash |
OLD | NEW |