OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/panels/base_panel_browser_test.h" | 5 #include "chrome/browser/ui/panels/base_panel_browser_test.h" |
6 #include "chrome/browser/ui/panels/panel.h" | 6 #include "chrome/browser/ui/panels/panel.h" |
7 #include "chrome/browser/ui/panels/panel_constants.h" | 7 #include "chrome/browser/ui/panels/panel_constants.h" |
8 #include "chrome/browser/ui/views/panels/panel_frame_view.h" | 8 #include "chrome/browser/ui/views/panels/panel_frame_view.h" |
9 #include "chrome/browser/ui/views/panels/panel_view.h" | 9 #include "chrome/browser/ui/views/panels/panel_view.h" |
10 #include "chrome/browser/ui/views/tab_icon_view.h" | 10 #include "chrome/browser/ui/views/tab_icon_view.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 EXPECT_GT(minimize_button->height(), 0); | 128 EXPECT_GT(minimize_button->height(), 0); |
129 EXPECT_LT(minimize_button->height(), titlebar_height); | 129 EXPECT_LT(minimize_button->height(), titlebar_height); |
130 EXPECT_GT(close_button->width(), 0); | 130 EXPECT_GT(close_button->width(), 0); |
131 EXPECT_GT(close_button->height(), 0); | 131 EXPECT_GT(close_button->height(), 0); |
132 EXPECT_LT(close_button->height(), titlebar_height); | 132 EXPECT_LT(close_button->height(), titlebar_height); |
133 EXPECT_LT(title_icon->x() + title_icon->width(), title_text->x()); | 133 EXPECT_LT(title_icon->x() + title_icon->width(), title_text->x()); |
134 EXPECT_LT(title_text->x() + title_text->width(), minimize_button->x()); | 134 EXPECT_LT(title_text->x() + title_text->width(), minimize_button->x()); |
135 EXPECT_LT(minimize_button->x() + minimize_button->width(), close_button->x()); | 135 EXPECT_LT(minimize_button->x() + minimize_button->width(), close_button->x()); |
136 } | 136 } |
137 | 137 |
138 // TODO(pkotwicz): Enable on Linux crbug.com/382301 | |
pkotwicz
2014/07/07 14:55:47
I will reenable these tests as part of a followup
| |
139 #if !defined(OS_LINUX) | |
140 | |
138 IN_PROC_BROWSER_TEST_F(PanelViewTest, CheckTitleOnlyHeight) { | 141 IN_PROC_BROWSER_TEST_F(PanelViewTest, CheckTitleOnlyHeight) { |
139 gfx::Rect bounds(0, 0, 200, 50); | 142 gfx::Rect bounds(0, 0, 200, 50); |
140 Panel* panel = CreatePanelWithBounds("PanelTest", bounds); | 143 Panel* panel = CreatePanelWithBounds("PanelTest", bounds); |
141 | 144 |
142 // Change panel to title-only and check its height. | 145 // Change panel to title-only and check its height. |
143 panel->SetExpansionState(Panel::TITLE_ONLY); | 146 panel->SetExpansionState(Panel::TITLE_ONLY); |
144 WaitForBoundsAnimationFinished(panel); | 147 WaitForBoundsAnimationFinished(panel); |
145 EXPECT_EQ(panel->TitleOnlyHeight(), panel->GetBounds().height()); | 148 EXPECT_EQ(panel->TitleOnlyHeight(), panel->GetBounds().height()); |
146 EXPECT_EQ(0, GetPanelView(panel)->height()); // client area height. | 149 EXPECT_EQ(0, GetPanelView(panel)->height()); // client area height. |
147 | 150 |
148 panel->Close(); | 151 panel->Close(); |
149 } | 152 } |
150 | 153 |
151 IN_PROC_BROWSER_TEST_F(PanelViewTest, CheckMinimizedHeight) { | 154 IN_PROC_BROWSER_TEST_F(PanelViewTest, CheckMinimizedHeight) { |
152 gfx::Rect bounds(0, 0, 200, 50); | 155 gfx::Rect bounds(0, 0, 200, 50); |
153 Panel* panel = CreatePanelWithBounds("PanelTest", bounds); | 156 Panel* panel = CreatePanelWithBounds("PanelTest", bounds); |
154 | 157 |
155 // Change panel to minimized and check its height. | 158 // Change panel to minimized and check its height. |
156 panel->SetExpansionState(Panel::MINIMIZED); | 159 panel->SetExpansionState(Panel::MINIMIZED); |
157 WaitForBoundsAnimationFinished(panel); | 160 WaitForBoundsAnimationFinished(panel); |
158 EXPECT_EQ(panel::kMinimizedPanelHeight, panel->GetBounds().height()); | 161 EXPECT_EQ(panel::kMinimizedPanelHeight, panel->GetBounds().height()); |
159 EXPECT_EQ(0, GetPanelView(panel)->height()); // client area height. | 162 EXPECT_EQ(0, GetPanelView(panel)->height()); // client area height. |
160 | 163 |
161 panel->Close(); | 164 panel->Close(); |
162 } | 165 } |
166 #endif | |
OLD | NEW |