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

Unified Diff: ash/wm/header_painter_unittest.cc

Issue 123023002: Remove "solo window" feature (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/wm/header_painter.cc ('k') | ash/wm/panels/panel_frame_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/header_painter_unittest.cc
diff --git a/ash/wm/header_painter_unittest.cc b/ash/wm/header_painter_unittest.cc
index 8ce8917a58117f8e2bf6a398e06c250ccbf198d1..2bc71dd3586bb50a112e32c3345d4cd217333dec 100644
--- a/ash/wm/header_painter_unittest.cc
+++ b/ash/wm/header_painter_unittest.cc
@@ -18,55 +18,6 @@ using ash::HeaderPainter;
using views::NonClientFrameView;
using views::Widget;
-namespace {
-
-// Modifies the values of kInactiveWindowOpacity, kActiveWindowOpacity, and
-// kSoloWindowOpacity for the lifetime of the class. This is useful so that
-// the constants each have different values.
-class ScopedOpacityConstantModifier {
- public:
- ScopedOpacityConstantModifier()
- : initial_active_window_opacity_(
- ash::HeaderPainter::kActiveWindowOpacity),
- initial_inactive_window_opacity_(
- ash::HeaderPainter::kInactiveWindowOpacity),
- initial_solo_window_opacity_(ash::HeaderPainter::kSoloWindowOpacity) {
- ash::HeaderPainter::kActiveWindowOpacity = 100;
- ash::HeaderPainter::kInactiveWindowOpacity = 120;
- ash::HeaderPainter::kSoloWindowOpacity = 140;
- }
- ~ScopedOpacityConstantModifier() {
- ash::HeaderPainter::kActiveWindowOpacity = initial_active_window_opacity_;
- ash::HeaderPainter::kInactiveWindowOpacity =
- initial_inactive_window_opacity_;
- ash::HeaderPainter::kSoloWindowOpacity = initial_solo_window_opacity_;
- }
-
- private:
- int initial_active_window_opacity_;
- int initial_inactive_window_opacity_;
- int initial_solo_window_opacity_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedOpacityConstantModifier);
-};
-
-// Creates a new HeaderPainter with empty buttons. Caller owns the memory.
-HeaderPainter* CreateTestPainter(Widget* widget) {
- HeaderPainter* painter = new HeaderPainter();
- NonClientFrameView* frame_view = widget->non_client_view()->frame_view();
- ash::FrameCaptionButtonContainerView* container =
- new ash::FrameCaptionButtonContainerView(
- widget,
- ash::FrameCaptionButtonContainerView::MINIMIZE_ALLOWED);
- // Add the container to the widget's non-client frame view so that it will be
- // deleted when the widget is destroyed.
- frame_view->AddChildView(container);
- painter->Init(widget, frame_view, NULL, container);
- return painter;
-}
-
-} // namespace
-
namespace ash {
class HeaderPainterTest : public ash::test::AshTestBase {
@@ -82,47 +33,6 @@ class HeaderPainterTest : public ash::test::AshTestBase {
}
};
-TEST_F(HeaderPainterTest, GetHeaderOpacity) {
- // Create a widget and a painter for it.
- scoped_ptr<Widget> w1(CreateTestWidget());
- scoped_ptr<HeaderPainter> p1(CreateTestPainter(w1.get()));
- w1->Show();
-
- // Modify the values of the opacity constants so that they each have a
- // different value.
- ScopedOpacityConstantModifier opacity_constant_modifier;
-
- // Solo active window has solo window opacity.
- EXPECT_EQ(HeaderPainter::kSoloWindowOpacity,
- p1->GetHeaderOpacity(HeaderPainter::ACTIVE,
- IDR_AURA_WINDOW_HEADER_BASE_ACTIVE,
- 0));
-
- // Create a second widget and painter.
- scoped_ptr<Widget> w2(CreateTestWidget());
- scoped_ptr<HeaderPainter> p2(CreateTestPainter(w2.get()));
- w2->Show();
-
- // Active window has active window opacity.
- EXPECT_EQ(HeaderPainter::kActiveWindowOpacity,
- p2->GetHeaderOpacity(HeaderPainter::ACTIVE,
- IDR_AURA_WINDOW_HEADER_BASE_ACTIVE,
- 0));
-
- // Inactive window has inactive window opacity.
- EXPECT_EQ(HeaderPainter::kInactiveWindowOpacity,
- p2->GetHeaderOpacity(HeaderPainter::INACTIVE,
- IDR_AURA_WINDOW_HEADER_BASE_INACTIVE,
- 0));
-
- // Regular maximized windows are fully opaque.
- wm::GetWindowState(w1->GetNativeWindow())->Maximize();
- EXPECT_EQ(255,
- p1->GetHeaderOpacity(HeaderPainter::ACTIVE,
- IDR_AURA_WINDOW_HEADER_BASE_ACTIVE,
- 0));
-}
-
// Ensure the title text is vertically aligned with the window icon.
TEST_F(HeaderPainterTest, TitleIconAlignment) {
scoped_ptr<Widget> w(CreateTestWidget());
« no previous file with comments | « ash/wm/header_painter.cc ('k') | ash/wm/panels/panel_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698