OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 // Create 2 more panels for more testing. | 235 // Create 2 more panels for more testing. |
236 Panel* panel2 = CreatePanel("PanelTest2"); | 236 Panel* panel2 = CreatePanel("PanelTest2"); |
237 Panel* panel3 = CreatePanel("PanelTest3"); | 237 Panel* panel3 = CreatePanel("PanelTest3"); |
238 | 238 |
239 // Test bringing up or down the title-bar of all minimized panels. | 239 // Test bringing up or down the title-bar of all minimized panels. |
240 EXPECT_EQ(Panel::EXPANDED, panel2->expansion_state()); | 240 EXPECT_EQ(Panel::EXPANDED, panel2->expansion_state()); |
241 panel3->SetExpansionState(Panel::MINIMIZED); | 241 panel3->SetExpansionState(Panel::MINIMIZED); |
242 EXPECT_EQ(Panel::MINIMIZED, panel3->expansion_state()); | 242 EXPECT_EQ(Panel::MINIMIZED, panel3->expansion_state()); |
243 EXPECT_EQ(2, panel_manager->minimized_panel_count()); | 243 EXPECT_EQ(2, panel_manager->minimized_panel_count()); |
244 | 244 |
245 // TODO(dimich): Either remove this test in favor of platform-independent | |
246 // one, or fix it. It is broken because are_titlebars_up_ in PanelManager | |
247 // is not in sync with requested state of titlebars. | |
248 // http://crbug.com/102733 | |
249 /* | |
250 mock_auto_hiding_desktop_bar()->SetVisibility( | 245 mock_auto_hiding_desktop_bar()->SetVisibility( |
251 AutoHidingDesktopBar::ALIGN_BOTTOM, AutoHidingDesktopBar::VISIBLE); | 246 AutoHidingDesktopBar::ALIGN_BOTTOM, AutoHidingDesktopBar::VISIBLE); |
252 panel_manager->BringUpOrDownTitlebars(true); | 247 panel_manager->BringUpOrDownTitlebars(true); |
253 MessageLoopForUI::current()->RunAllPending(); | 248 MessageLoopForUI::current()->RunAllPending(); |
254 EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state()); | 249 EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state()); |
255 EXPECT_EQ(Panel::EXPANDED, panel2->expansion_state()); | 250 EXPECT_EQ(Panel::EXPANDED, panel2->expansion_state()); |
256 EXPECT_EQ(Panel::TITLE_ONLY, panel3->expansion_state()); | 251 EXPECT_EQ(Panel::TITLE_ONLY, panel3->expansion_state()); |
257 EXPECT_EQ(2, panel_manager->minimized_panel_count()); | 252 EXPECT_EQ(2, panel_manager->minimized_panel_count()); |
258 | 253 |
259 mock_auto_hiding_desktop_bar()->SetVisibility( | 254 mock_auto_hiding_desktop_bar()->SetVisibility( |
260 AutoHidingDesktopBar::ALIGN_BOTTOM, AutoHidingDesktopBar::HIDDEN); | 255 AutoHidingDesktopBar::ALIGN_BOTTOM, AutoHidingDesktopBar::HIDDEN); |
261 panel_manager->BringUpOrDownTitlebars(false); | 256 panel_manager->BringUpOrDownTitlebars(false); |
262 MessageLoopForUI::current()->RunAllPending(); | 257 MessageLoopForUI::current()->RunAllPending(); |
263 EXPECT_EQ(Panel::MINIMIZED, panel1->expansion_state()); | 258 EXPECT_EQ(Panel::MINIMIZED, panel1->expansion_state()); |
264 EXPECT_EQ(Panel::EXPANDED, panel2->expansion_state()); | 259 EXPECT_EQ(Panel::EXPANDED, panel2->expansion_state()); |
265 EXPECT_EQ(Panel::MINIMIZED, panel3->expansion_state()); | 260 EXPECT_EQ(Panel::MINIMIZED, panel3->expansion_state()); |
266 EXPECT_EQ(2, panel_manager->minimized_panel_count()); | 261 EXPECT_EQ(2, panel_manager->minimized_panel_count()); |
267 */ | |
268 | 262 |
269 // Test if it is OK to bring up title-bar given the mouse position. | 263 // Test if it is OK to bring up title-bar given the mouse position. |
270 EXPECT_TRUE(panel_manager->ShouldBringUpTitlebars( | 264 EXPECT_TRUE(panel_manager->ShouldBringUpTitlebars( |
271 panel1->GetBounds().x(), panel1->GetBounds().y())); | 265 panel1->GetBounds().x(), panel1->GetBounds().y())); |
272 EXPECT_FALSE(panel_manager->ShouldBringUpTitlebars( | 266 EXPECT_FALSE(panel_manager->ShouldBringUpTitlebars( |
273 panel2->GetBounds().x(), panel2->GetBounds().y())); | 267 panel2->GetBounds().x(), panel2->GetBounds().y())); |
274 EXPECT_TRUE(panel_manager->ShouldBringUpTitlebars( | 268 EXPECT_TRUE(panel_manager->ShouldBringUpTitlebars( |
275 panel3->GetBounds().right() - 1, panel3->GetBounds().bottom() - 1)); | 269 panel3->GetBounds().right() - 1, panel3->GetBounds().bottom() - 1)); |
276 EXPECT_TRUE(panel_manager->ShouldBringUpTitlebars( | 270 EXPECT_TRUE(panel_manager->ShouldBringUpTitlebars( |
277 panel3->GetBounds().right() - 1, panel3->GetBounds().bottom() + 10)); | 271 panel3->GetBounds().right() - 1, panel3->GetBounds().bottom() + 10)); |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 // TODO(jianli): Investigate why this fails on win trunk build. | 600 // TODO(jianli): Investigate why this fails on win trunk build. |
607 // http://crbug.com/102734 | 601 // http://crbug.com/102734 |
608 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, DISABLED_DrawAttention) { | 602 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, DISABLED_DrawAttention) { |
609 TestDrawAttention(); | 603 TestDrawAttention(); |
610 } | 604 } |
611 | 605 |
612 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, ChangeAutoHideTaskBarThickness) { | 606 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, ChangeAutoHideTaskBarThickness) { |
613 TestChangeAutoHideTaskBarThickness(); | 607 TestChangeAutoHideTaskBarThickness(); |
614 } | 608 } |
615 #endif | 609 #endif |
OLD | NEW |