| 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 "base/i18n/time_formatting.h" | 5 #include "base/i18n/time_formatting.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
| 10 #include "chrome/browser/ui/panels/base_panel_browser_test.h" | 10 #include "chrome/browser/ui/panels/base_panel_browser_test.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 expected_bottom_on_title_only -= bottom_thickness; | 193 expected_bottom_on_title_only -= bottom_thickness; |
| 194 | 194 |
| 195 // Create and test one panel first. | 195 // Create and test one panel first. |
| 196 Panel* panel1 = CreatePanel("PanelTest1"); | 196 Panel* panel1 = CreatePanel("PanelTest1"); |
| 197 PanelBrowserView* browser_view1 = GetBrowserView(panel1); | 197 PanelBrowserView* browser_view1 = GetBrowserView(panel1); |
| 198 PanelBrowserFrameView* frame_view1 = browser_view1->GetFrameView(); | 198 PanelBrowserFrameView* frame_view1 = browser_view1->GetFrameView(); |
| 199 | 199 |
| 200 // Test minimizing/restoring an individual panel. | 200 // Test minimizing/restoring an individual panel. |
| 201 EXPECT_EQ(Panel::EXPANDED, panel1->expansion_state()); | 201 EXPECT_EQ(Panel::EXPANDED, panel1->expansion_state()); |
| 202 int initial_height = panel1->GetBounds().height(); | 202 int initial_height = panel1->GetBounds().height(); |
| 203 int titlebar_height = frame_view1->NonClientTopBorderHeight(); | |
| 204 | 203 |
| 205 panel1->SetExpansionState(Panel::MINIMIZED); | 204 panel1->SetExpansionState(Panel::MINIMIZED); |
| 206 EXPECT_EQ(Panel::MINIMIZED, panel1->expansion_state()); | 205 EXPECT_EQ(Panel::MINIMIZED, panel1->expansion_state()); |
| 206 |
| 207 int titlebar_height = frame_view1->NonClientTopBorderHeight(); |
| 207 EXPECT_LT(panel1->GetBounds().height(), titlebar_height); | 208 EXPECT_LT(panel1->GetBounds().height(), titlebar_height); |
| 208 EXPECT_GT(panel1->GetBounds().height(), 0); | 209 EXPECT_GT(panel1->GetBounds().height(), 0); |
| 209 EXPECT_EQ(expected_bottom_on_minimized, panel1->GetBounds().bottom()); | 210 EXPECT_EQ(expected_bottom_on_minimized, panel1->GetBounds().bottom()); |
| 210 WaitTillBoundsAnimationFinished(panel1); | 211 WaitTillBoundsAnimationFinished(panel1); |
| 211 EXPECT_FALSE(panel1->IsActive()); | 212 EXPECT_FALSE(panel1->IsActive()); |
| 212 | 213 |
| 213 panel1->SetExpansionState(Panel::TITLE_ONLY); | 214 panel1->SetExpansionState(Panel::TITLE_ONLY); |
| 214 EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state()); | 215 EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state()); |
| 215 EXPECT_EQ(titlebar_height, panel1->GetBounds().height()); | 216 EXPECT_EQ(titlebar_height, panel1->GetBounds().height()); |
| 216 EXPECT_EQ(expected_bottom_on_title_only, panel1->GetBounds().bottom()); | 217 EXPECT_EQ(expected_bottom_on_title_only, panel1->GetBounds().bottom()); |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, | 553 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, |
| 553 MinimizeAndRestoreOnAutoHideTaskBar) { | 554 MinimizeAndRestoreOnAutoHideTaskBar) { |
| 554 TestMinimizeAndRestore(true); | 555 TestMinimizeAndRestore(true); |
| 555 } | 556 } |
| 556 | 557 |
| 557 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, | 558 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, |
| 558 ChangeAutoHideTaskBarThickness) { | 559 ChangeAutoHideTaskBarThickness) { |
| 559 TestChangeAutoHideTaskBarThickness(); | 560 TestChangeAutoHideTaskBarThickness(); |
| 560 } | 561 } |
| 561 #endif | 562 #endif |
| OLD | NEW |