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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 137 |
138 IN_PROC_BROWSER_TEST_F(PanelViewTest, CheckTitleOnlyHeight) { | 138 IN_PROC_BROWSER_TEST_F(PanelViewTest, CheckTitleOnlyHeight) { |
139 gfx::Rect bounds(0, 0, 200, 50); | 139 gfx::Rect bounds(0, 0, 200, 50); |
140 Panel* panel = CreatePanelWithBounds("PanelTest", bounds); | 140 Panel* panel = CreatePanelWithBounds("PanelTest", bounds); |
141 | 141 |
142 // Change panel to title-only and check its height. | 142 // Change panel to title-only and check its height. |
143 panel->SetExpansionState(Panel::TITLE_ONLY); | 143 panel->SetExpansionState(Panel::TITLE_ONLY); |
144 WaitForBoundsAnimationFinished(panel); | 144 WaitForBoundsAnimationFinished(panel); |
145 EXPECT_EQ(panel->TitleOnlyHeight(), panel->GetBounds().height()); | 145 EXPECT_EQ(panel->TitleOnlyHeight(), panel->GetBounds().height()); |
146 EXPECT_EQ(0, GetPanelView(panel)->height()); // client area height. | 146 EXPECT_EQ(0, GetPanelView(panel)->height()); // client area height. |
147 #if defined(OS_WIN) && !defined(USE_AURA) | |
148 EXPECT_EQ(panel->TitleOnlyHeight(), | |
149 GetPanelView(panel)->GetFrameView()->height()); | |
150 #endif | |
151 | 147 |
152 panel->Close(); | 148 panel->Close(); |
153 } | 149 } |
154 | 150 |
155 IN_PROC_BROWSER_TEST_F(PanelViewTest, CheckMinimizedHeight) { | 151 IN_PROC_BROWSER_TEST_F(PanelViewTest, CheckMinimizedHeight) { |
156 gfx::Rect bounds(0, 0, 200, 50); | 152 gfx::Rect bounds(0, 0, 200, 50); |
157 Panel* panel = CreatePanelWithBounds("PanelTest", bounds); | 153 Panel* panel = CreatePanelWithBounds("PanelTest", bounds); |
158 | 154 |
159 // Change panel to minimized and check its height. | 155 // Change panel to minimized and check its height. |
160 panel->SetExpansionState(Panel::MINIMIZED); | 156 panel->SetExpansionState(Panel::MINIMIZED); |
161 WaitForBoundsAnimationFinished(panel); | 157 WaitForBoundsAnimationFinished(panel); |
162 EXPECT_EQ(panel::kMinimizedPanelHeight, panel->GetBounds().height()); | 158 EXPECT_EQ(panel::kMinimizedPanelHeight, panel->GetBounds().height()); |
163 EXPECT_EQ(0, GetPanelView(panel)->height()); // client area height. | 159 EXPECT_EQ(0, GetPanelView(panel)->height()); // client area height. |
164 #if defined(OS_WIN) && !defined(USE_AURA) | |
165 EXPECT_EQ(panel::kMinimizedPanelHeight, | |
166 GetPanelView(panel)->GetFrameView()->height()); | |
167 #endif | |
168 | 160 |
169 panel->Close(); | 161 panel->Close(); |
170 } | 162 } |
OLD | NEW |