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

Unified Diff: ash/shell_unittest.cc

Issue 11418114: Add policy for ash launcher auto-hide behavior (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed- Rebased. Created 8 years, 1 month 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
Index: ash/shell_unittest.cc
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index 8885320cd5c267e9c4f0210782580abe2a67289a..6fbab6ae359f2bd7d687d8652c82ba1ad84f06b5 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -352,8 +352,8 @@ std::vector<aura::Window*> BuildPathToRoot(aura::Window* window) {
} // namespace
-// Various assertions around IsAutoHideMenuHideChecked() and
-// ToggleAutoHideMenu().
+// Various assertions around SetShelfAutoHideBehavior() and
+// GetShelfAutoHideBehavior().
TEST_F(ShellTest, ToggleAutoHide) {
scoped_ptr<aura::Window> window(new aura::Window(NULL));
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
@@ -363,28 +363,27 @@ TEST_F(ShellTest, ToggleAutoHide) {
window->Show();
wm::ActivateWindow(window.get());
- internal::RootWindowController* controller =
- Shell::GetPrimaryRootWindowController();
- controller->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ Shell* shell = Shell::GetInstance();
+ aura::RootWindow* root_window = Shell::GetPrimaryRootWindow();
+ shell->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
+ root_window);
EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
- controller->GetShelfAutoHideBehavior());
- EXPECT_TRUE(controller->IsShelfAutoHideMenuHideChecked());
- controller->SetShelfAutoHideBehavior(
- controller->GetToggledShelfAutoHideBehavior());
+ shell->GetShelfAutoHideBehavior(root_window));
+ shell->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER,
+ root_window);
EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER,
- controller->GetShelfAutoHideBehavior());
-
+ shell->GetShelfAutoHideBehavior(root_window));
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
- EXPECT_FALSE(controller->IsShelfAutoHideMenuHideChecked());
- controller->SetShelfAutoHideBehavior(
- controller->GetToggledShelfAutoHideBehavior());
+ 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,
- controller->GetShelfAutoHideBehavior());
- EXPECT_TRUE(controller->IsShelfAutoHideMenuHideChecked());
- controller->SetShelfAutoHideBehavior(
- controller->GetToggledShelfAutoHideBehavior());
+ shell->GetShelfAutoHideBehavior(root_window));
+ shell->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER,
+ root_window);
EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER,
- controller->GetShelfAutoHideBehavior());
+ shell->GetShelfAutoHideBehavior(root_window));
}
// This verifies WindowObservers are removed when a window is destroyed after

Powered by Google App Engine
This is Rietveld 408576698