OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 #include "chrome/browser/ui/panels/base_panel_browser_test.h" | 6 #include "chrome/browser/ui/panels/base_panel_browser_test.h" |
7 #include "chrome/browser/ui/panels/detached_panel_collection.h" | 7 #include "chrome/browser/ui/panels/detached_panel_collection.h" |
8 #include "chrome/browser/ui/panels/docked_panel_collection.h" | 8 #include "chrome/browser/ui/panels/docked_panel_collection.h" |
9 #include "chrome/browser/ui/panels/native_panel.h" | 9 #include "chrome/browser/ui/panels/native_panel.h" |
10 #include "chrome/browser/ui/panels/panel.h" | 10 #include "chrome/browser/ui/panels/panel.h" |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 ASSERT_EQ(1, panel_manager->num_panels()); | 1227 ASSERT_EQ(1, panel_manager->num_panels()); |
1228 ASSERT_EQ(0, panel_manager->num_stacks()); | 1228 ASSERT_EQ(0, panel_manager->num_stacks()); |
1229 EXPECT_EQ(PanelCollection::DETACHED, panel3->collection()->type()); | 1229 EXPECT_EQ(PanelCollection::DETACHED, panel3->collection()->type()); |
1230 | 1230 |
1231 panel3_expected_bounds.set_y(panel2_expected_bounds.y()); | 1231 panel3_expected_bounds.set_y(panel2_expected_bounds.y()); |
1232 EXPECT_EQ(panel3_expected_bounds, panel3->GetBounds()); | 1232 EXPECT_EQ(panel3_expected_bounds, panel3->GetBounds()); |
1233 | 1233 |
1234 panel_manager->CloseAll(); | 1234 panel_manager->CloseAll(); |
1235 } | 1235 } |
1236 | 1236 |
1237 IN_PROC_BROWSER_TEST_F(StackedPanelBrowserTest, FocusNextPanelOnPanelClose) { | 1237 // Skip the test since active state might not be fully supported for some window |
| 1238 // managers. |
| 1239 #if defined(OS_MACOSX) |
| 1240 #define MAYBE_FocusNextPanelOnPanelClose DISABLED_FocusNextPanelOnPanelClose |
| 1241 #else |
| 1242 #define MAYBE_FocusNextPanelOnPanelClose FocusNextPanelOnPanelClose |
| 1243 #endif |
| 1244 IN_PROC_BROWSER_TEST_F(StackedPanelBrowserTest, |
| 1245 MAYBE_FocusNextPanelOnPanelClose) { |
1238 PanelManager* panel_manager = PanelManager::GetInstance(); | 1246 PanelManager* panel_manager = PanelManager::GetInstance(); |
1239 | 1247 |
1240 // Create 3 stacked panels. | 1248 // Create 3 stacked panels. |
1241 StackedPanelCollection* stack = panel_manager->CreateStack(); | 1249 StackedPanelCollection* stack = panel_manager->CreateStack(); |
1242 Panel* panel1 = CreateStackedPanel("1", gfx::Rect(100, 50, 200, 200), stack); | 1250 Panel* panel1 = CreateStackedPanel("1", gfx::Rect(100, 50, 200, 200), stack); |
1243 Panel* panel2 = CreateStackedPanel("2", gfx::Rect(0, 0, 150, 100), stack); | 1251 Panel* panel2 = CreateStackedPanel("2", gfx::Rect(0, 0, 150, 100), stack); |
1244 Panel* panel3 = CreateStackedPanel("3", gfx::Rect(0, 0, 150, 120), stack); | 1252 Panel* panel3 = CreateStackedPanel("3", gfx::Rect(0, 0, 150, 120), stack); |
1245 ASSERT_EQ(3, stack->num_panels()); | 1253 ASSERT_EQ(3, stack->num_panels()); |
1246 ASSERT_FALSE(panel1->IsActive()); | 1254 ASSERT_FALSE(panel1->IsActive()); |
1247 ASSERT_FALSE(panel2->IsActive()); | 1255 ASSERT_FALSE(panel2->IsActive()); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1450 EXPECT_TRUE(panel1_testing->IsWindowVisible()); | 1458 EXPECT_TRUE(panel1_testing->IsWindowVisible()); |
1451 EXPECT_TRUE(panel2_testing->IsWindowVisible()); | 1459 EXPECT_TRUE(panel2_testing->IsWindowVisible()); |
1452 | 1460 |
1453 // Panels' visibility should not be affected when leaving full-screen mode. | 1461 // Panels' visibility should not be affected when leaving full-screen mode. |
1454 mock_display_settings_provider()->EnableFullScreenMode(false); | 1462 mock_display_settings_provider()->EnableFullScreenMode(false); |
1455 EXPECT_TRUE(panel1_testing->IsWindowVisible()); | 1463 EXPECT_TRUE(panel1_testing->IsWindowVisible()); |
1456 EXPECT_TRUE(panel2_testing->IsWindowVisible()); | 1464 EXPECT_TRUE(panel2_testing->IsWindowVisible()); |
1457 | 1465 |
1458 panel_manager->CloseAll(); | 1466 panel_manager->CloseAll(); |
1459 } | 1467 } |
OLD | NEW |