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 // Verify the hit bounds of the status area extend to the edge of the shelf. | |
1840 TEST_F(ShelfLayoutManagerTest, StatusAreaHitBoxCoversEdge) { | |
1841 UpdateDisplay("400x400"); | |
1842 ShelfLayoutManager* shelf = GetShelfLayoutManager(); | |
1843 StatusAreaWidget* status_area_widget = | |
1844 Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget(); | |
1845 aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); | |
1846 generator.MoveMouseTo(399,399); | |
1847 | |
1848 // Test bottom right pixel for bottom alignment. | |
1849 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); | |
1850 generator.ClickLeftButton(); | |
1851 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); | |
1852 generator.ClickLeftButton(); | |
1853 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); | |
1854 | |
1855 // Test bottom right pixel for right alignment. | |
1856 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT); | |
1857 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); | |
1858 generator.ClickLeftButton(); | |
1859 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); | |
1860 generator.ClickLeftButton(); | |
1861 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); | |
1862 | |
1863 // Test bottom left pixel for left alignment. | |
James Cook
2013/09/18 01:36:07
Nice, I didn't think of that case. Good test.
| |
1864 generator.MoveMouseTo(0, 399); | |
1865 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); | |
1866 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); | |
1867 generator.ClickLeftButton(); | |
1868 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); | |
1869 generator.ClickLeftButton(); | |
1870 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); | |
1871 } | |
1872 | |
1839 } // namespace internal | 1873 } // namespace internal |
1840 } // namespace ash | 1874 } // namespace ash |
OLD | NEW |