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

Unified Diff: ash/shell_unittest.cc

Issue 2020623004: ash: Move shelf alignment and auto-hide calls from Shell to Shelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell/context_menu.cc ('k') | ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell_unittest.cc
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index 3e0c765790a5548e1e7c9c5b9d461b762fda8e30..1ba941f36b8917231acf851edb15bc70b1b38c6e 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -443,8 +443,8 @@ TEST_F(ShellTest, FullscreenWindowHidesShelf) {
widget->Close();
}
-// Various assertions around SetShelfAutoHideBehavior() and
-// GetShelfAutoHideBehavior().
+// Various assertions around auto-hide behavior.
+// TODO(jamescook): Move this to ShelfTest.
TEST_F(ShellTest, ToggleAutoHide) {
std::unique_ptr<aura::Window> window(new aura::Window(NULL));
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
@@ -454,27 +454,21 @@ TEST_F(ShellTest, ToggleAutoHide) {
window->Show();
wm::ActivateWindow(window.get());
- Shell* shell = Shell::GetInstance();
- aura::Window* root_window = Shell::GetPrimaryRootWindow();
- shell->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
- root_window);
- EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
- shell->GetShelfAutoHideBehavior(root_window));
- shell->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER,
- root_window);
- EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER,
- shell->GetShelfAutoHideBehavior(root_window));
+ Shelf* shelf = Shelf::ForPrimaryDisplay();
+ shelf->SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
+
+ shelf->SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
+ EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior());
+
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
- EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER,
- shell->GetShelfAutoHideBehavior(root_window));
- shell->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
- root_window);
- EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
- shell->GetShelfAutoHideBehavior(root_window));
- shell->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER,
- root_window);
- EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER,
- shell->GetShelfAutoHideBehavior(root_window));
+ EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior());
+
+ shelf->SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
+
+ shelf->SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
+ EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior());
}
// Tests that the cursor-filter is ahead of the drag-drop controller in the
« no previous file with comments | « ash/shell/context_menu.cc ('k') | ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698