Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 23928004: ash:Shelf - Update position and hit box of status area. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: maybe Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/shelf/shelf_layout_manager.cc ('k') | ash/system/status_area_widget_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ash/shelf/shelf_layout_manager.cc ('k') | ash/system/status_area_widget_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698