diff options
author | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-08 06:26:22 +0000 |
---|---|---|
committer | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-08 06:26:22 +0000 |
commit | 73e6e0f3a0979df7fab0fe2b95e037a22acc6701 (patch) | |
tree | ca41cd467f2e74c0b7df818c350571b24dad6058 /ash/wm/header_painter_unittest.cc | |
parent | 9056e73d3c1f5570a77d2e3a8b8bb7c5ef1b6aa2 (diff) | |
download | chromium_src-73e6e0f3a0979df7fab0fe2b95e037a22acc6701.zip chromium_src-73e6e0f3a0979df7fab0fe2b95e037a22acc6701.tar.gz chromium_src-73e6e0f3a0979df7fab0fe2b95e037a22acc6701.tar.bz2 |
The new design of the window headers does not use a super transparent window header when there is just one window on screen.
The solo window feature is also broken in the M32 and M33 branches (crbug.com/330212)
BUG=297187
TEST=None
R=jamescook
TBR=oshima (For trivial change in chrome/browser/chromeos/login/login_display_host_impl.*)
Review URL: https://codereview.chromium.org/123023002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243500 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/header_painter_unittest.cc')
-rw-r--r-- | ash/wm/header_painter_unittest.cc | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/ash/wm/header_painter_unittest.cc b/ash/wm/header_painter_unittest.cc index 8ce8917..2bc71dd 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()); |