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/message_loop.h" | 5 #include "base/message_loop.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 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1416 EXPECT_EQ(PanelCollection::DETACHED, panel2->collection()->type()); | 1416 EXPECT_EQ(PanelCollection::DETACHED, panel2->collection()->type()); |
1417 EXPECT_EQ(PanelCollection::DOCKED, panel3->collection()->type()); | 1417 EXPECT_EQ(PanelCollection::DOCKED, panel3->collection()->type()); |
1418 EXPECT_EQ(PanelCollection::DOCKED, panel4->collection()->type()); | 1418 EXPECT_EQ(PanelCollection::DOCKED, panel4->collection()->type()); |
1419 EXPECT_EQ(PanelCollection::DOCKED, panel5->collection()->type()); | 1419 EXPECT_EQ(PanelCollection::DOCKED, panel5->collection()->type()); |
1420 EXPECT_EQ(PanelCollection::DOCKED, panel6->collection()->type()); | 1420 EXPECT_EQ(PanelCollection::DOCKED, panel6->collection()->type()); |
1421 EXPECT_EQ(PanelCollection::DOCKED, panel7->collection()->type()); | 1421 EXPECT_EQ(PanelCollection::DOCKED, panel7->collection()->type()); |
1422 EXPECT_EQ(detached_position1, panel1->GetBounds().origin()); | 1422 EXPECT_EQ(detached_position1, panel1->GetBounds().origin()); |
1423 EXPECT_EQ(detached_position2, panel2->GetBounds().origin()); | 1423 EXPECT_EQ(detached_position2, panel2->GetBounds().origin()); |
1424 | 1424 |
1425 // Wait for active states to settle. | 1425 // Wait for active states to settle. |
1426 MessageLoopForUI::current()->RunUntilIdle(); | 1426 base::MessageLoopForUI::current()->RunUntilIdle(); |
1427 | 1427 |
1428 // Panel positions should have shifted because of the "squeeze" mode. | 1428 // Panel positions should have shifted because of the "squeeze" mode. |
1429 EXPECT_NE(docked_position4, panel4->GetBounds().origin()); | 1429 EXPECT_NE(docked_position4, panel4->GetBounds().origin()); |
1430 EXPECT_LT(panel4->GetBounds().width(), panel4->GetRestoredBounds().width()); | 1430 EXPECT_LT(panel4->GetBounds().width(), panel4->GetRestoredBounds().width()); |
1431 EXPECT_NE(docked_position5, panel5->GetBounds().origin()); | 1431 EXPECT_NE(docked_position5, panel5->GetBounds().origin()); |
1432 EXPECT_LT(panel5->GetBounds().width(), panel5->GetRestoredBounds().width()); | 1432 EXPECT_LT(panel5->GetBounds().width(), panel5->GetRestoredBounds().width()); |
1433 | 1433 |
1434 #if defined(OS_WIN) | 1434 #if defined(OS_WIN) |
1435 // The panel we dragged becomes the active one. | 1435 // The panel we dragged becomes the active one. |
1436 EXPECT_EQ(true, panel3->IsActive()); | 1436 EXPECT_EQ(true, panel3->IsActive()); |
(...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3141 panel1_expected_bounds.set_x(expected_x); | 3141 panel1_expected_bounds.set_x(expected_x); |
3142 panel1_expected_bounds.set_y(secondary_work_area.y()); | 3142 panel1_expected_bounds.set_y(secondary_work_area.y()); |
3143 EXPECT_EQ(panel1_expected_bounds, panel1->GetBounds()); | 3143 EXPECT_EQ(panel1_expected_bounds, panel1->GetBounds()); |
3144 panel2_expected_bounds.set_x(expected_x); | 3144 panel2_expected_bounds.set_x(expected_x); |
3145 panel2_expected_bounds.set_y(panel1_expected_bounds.bottom()); | 3145 panel2_expected_bounds.set_y(panel1_expected_bounds.bottom()); |
3146 EXPECT_EQ(panel2_expected_bounds, panel2->GetBounds()); | 3146 EXPECT_EQ(panel2_expected_bounds, panel2->GetBounds()); |
3147 | 3147 |
3148 panel_manager->CloseAll(); | 3148 panel_manager->CloseAll(); |
3149 } | 3149 } |
3150 #endif | 3150 #endif |
OLD | NEW |