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_controller.h" | 10 #include "ash/display/display_controller.h" |
(...skipping 1818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1829 | 1829 |
1830 GetShelfLayoutManager()->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 1830 GetShelfLayoutManager()->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
1831 scoped_ptr<aura::Window> w1(CreateTestWindow()); | 1831 scoped_ptr<aura::Window> w1(CreateTestWindow()); |
1832 w1->Show(); | 1832 w1->Show(); |
1833 wm::ActivateWindow(w1.get()); | 1833 wm::ActivateWindow(w1.get()); |
1834 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType()); | 1834 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType()); |
1835 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); | 1835 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
1836 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType()); | 1836 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType()); |
1837 } | 1837 } |
1838 | 1838 |
| 1839 #if defined(OS_CHROMEOS) |
| 1840 #define MAYBE_StatusAreaHitBoxCoversEdge StatusAreaHitBoxCoversEdge |
| 1841 #else |
| 1842 #define MAYBE_StatusAreaHitBoxCoversEdge DISABLED_StatusAreaHitBoxCoversEdge |
| 1843 #endif |
| 1844 |
| 1845 // Verify the hit bounds of the status area extend to the edge of the shelf. |
| 1846 TEST_F(ShelfLayoutManagerTest, MAYBE_StatusAreaHitBoxCoversEdge) { |
| 1847 UpdateDisplay("400x400"); |
| 1848 ShelfLayoutManager* shelf = GetShelfLayoutManager(); |
| 1849 StatusAreaWidget* status_area_widget = |
| 1850 Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget(); |
| 1851 aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); |
| 1852 generator.MoveMouseTo(399,399); |
| 1853 |
| 1854 // Test bottom right pixel for bottom alignment. |
| 1855 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); |
| 1856 generator.ClickLeftButton(); |
| 1857 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); |
| 1858 generator.ClickLeftButton(); |
| 1859 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); |
| 1860 |
| 1861 // Test bottom right pixel for right alignment. |
| 1862 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT); |
| 1863 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); |
| 1864 generator.ClickLeftButton(); |
| 1865 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); |
| 1866 generator.ClickLeftButton(); |
| 1867 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); |
| 1868 |
| 1869 // Test bottom left pixel for left alignment. |
| 1870 generator.MoveMouseTo(0, 399); |
| 1871 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); |
| 1872 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); |
| 1873 generator.ClickLeftButton(); |
| 1874 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); |
| 1875 generator.ClickLeftButton(); |
| 1876 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); |
| 1877 } |
| 1878 |
1839 } // namespace internal | 1879 } // namespace internal |
1840 } // namespace ash | 1880 } // namespace ash |
OLD | NEW |