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

Unified Diff: ash/common/frame/default_header_painter_unittest.cc

Issue 2736573002: chromeos: Move files in //ash/common to //ash, part 2 (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/frame/default_header_painter.cc ('k') | ash/common/frame/frame_border_hit_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/frame/default_header_painter_unittest.cc
diff --git a/ash/common/frame/default_header_painter_unittest.cc b/ash/common/frame/default_header_painter_unittest.cc
deleted file mode 100644
index 85d5ddd24254d15cbddcbba33adaf0ca1d0db471..0000000000000000000000000000000000000000
--- a/ash/common/frame/default_header_painter_unittest.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2014 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/common/frame/default_header_painter.h"
-
-#include <memory>
-
-#include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h"
-#include "ash/public/cpp/shell_window_ids.h"
-#include "ash/test/ash_test_base.h"
-#include "ui/views/test/test_views.h"
-#include "ui/views/widget/widget.h"
-#include "ui/views/window/non_client_view.h"
-
-using ash::HeaderPainter;
-using views::NonClientFrameView;
-using views::Widget;
-
-namespace ash {
-
-using DefaultHeaderPainterTest = test::AshTestBase;
-
-// Ensure the title text is vertically aligned with the window icon.
-TEST_F(DefaultHeaderPainterTest, TitleIconAlignment) {
- std::unique_ptr<Widget> w = CreateTestWidget(
- nullptr, kShellWindowId_DefaultContainer, gfx::Rect(1, 2, 3, 4));
- 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);
- painter.UpdateLeftHeaderView(&window_icon);
- painter.LayoutHeader();
- gfx::Rect title_bounds = painter.GetTitleBounds();
- EXPECT_EQ(window_icon.bounds().CenterPoint().y(),
- title_bounds.CenterPoint().y());
-}
-
-// Ensure the light icons are used when appropriate.
-TEST_F(DefaultHeaderPainterTest, LightIcons) {
- std::unique_ptr<Widget> w = CreateTestWidget(
- nullptr, kShellWindowId_DefaultContainer, gfx::Rect(1, 2, 3, 4));
- 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_FALSE(painter.ShouldUseLightImages());
- painter.mode_ = HeaderPainter::MODE_INACTIVE;
- EXPECT_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_TRUE(painter.ShouldUseLightImages());
- painter.mode_ = HeaderPainter::MODE_INACTIVE;
- EXPECT_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_TRUE(painter.ShouldUseLightImages());
- painter.mode_ = HeaderPainter::MODE_INACTIVE;
- EXPECT_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_TRUE(painter.ShouldUseLightImages());
- painter.mode_ = HeaderPainter::MODE_INACTIVE;
- EXPECT_FALSE(painter.ShouldUseLightImages());
-}
-
-} // namespace ash
« no previous file with comments | « ash/common/frame/default_header_painter.cc ('k') | ash/common/frame/frame_border_hit_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698