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 "ash/shelf/shelf_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 if (i) { | 1526 if (i) { |
1527 EXPECT_TRUE(shelf->IsVisible()); | 1527 EXPECT_TRUE(shelf->IsVisible()); |
1528 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); | 1528 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); |
1529 } else { | 1529 } else { |
1530 EXPECT_FALSE(shelf->IsVisible()); | 1530 EXPECT_FALSE(shelf->IsVisible()); |
1531 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); | 1531 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); |
1532 } | 1532 } |
1533 } | 1533 } |
1534 } | 1534 } |
1535 | 1535 |
| 1536 TEST_F(ShelfLayoutManagerTest, ShelfBackgroundColor) { |
| 1537 EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType()); |
| 1538 |
| 1539 scoped_ptr<aura::Window> w1(CreateTestWindow()); |
| 1540 w1->Show(); |
| 1541 wm::ActivateWindow(w1.get()); |
| 1542 EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType()); |
| 1543 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| 1544 EXPECT_EQ(SHELF_BACKGROUND_MAXIMIZED, GetShelfWidget()->GetBackgroundType()); |
| 1545 |
| 1546 scoped_ptr<aura::Window> w2(CreateTestWindow()); |
| 1547 w2->Show(); |
| 1548 wm::ActivateWindow(w2.get()); |
| 1549 // Overlaps with shelf. |
| 1550 w2->SetBounds(GetShelfLayoutManager()->GetIdealBounds()); |
| 1551 |
| 1552 // Still background is 'maximized'. |
| 1553 EXPECT_EQ(SHELF_BACKGROUND_MAXIMIZED, GetShelfWidget()->GetBackgroundType()); |
| 1554 |
| 1555 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); |
| 1556 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType()); |
| 1557 w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); |
| 1558 EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType()); |
| 1559 |
| 1560 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| 1561 EXPECT_EQ(SHELF_BACKGROUND_MAXIMIZED, GetShelfWidget()->GetBackgroundType()); |
| 1562 w1.reset(); |
| 1563 EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType()); |
| 1564 } |
| 1565 |
| 1566 // Verify that the shelf doesn't have the opaque background if it's auto-hide |
| 1567 // status. |
| 1568 TEST_F(ShelfLayoutManagerTest, ShelfBackgroundColorAutoHide) { |
| 1569 EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget ()->GetBackgroundType()); |
| 1570 |
| 1571 GetShelfLayoutManager()->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 1572 scoped_ptr<aura::Window> w1(CreateTestWindow()); |
| 1573 w1->Show(); |
| 1574 wm::ActivateWindow(w1.get()); |
| 1575 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType()); |
| 1576 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| 1577 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType()); |
| 1578 } |
| 1579 |
1536 } // namespace internal | 1580 } // namespace internal |
1537 } // namespace ash | 1581 } // namespace ash |
OLD | NEW |