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

Side by Side Diff: ash/launcher/launcher_context_menu_unittest.cc

Issue 10273012: ash: Fix shelf auto hide behavior not persisted regression. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 unified diff | Download patch | Annotate | Revision Log
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/launcher/launcher_context_menu.h" 5 #include "ash/launcher/launcher_context_menu.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/test/ash_test_base.h" 8 #include "ash/test/ash_test_base.h"
9 #include "ash/wm/property_util.h" 9 #include "ash/wm/property_util.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 15 matching lines...) Expand all
26 window->Init(ui::LAYER_TEXTURED); 26 window->Init(ui::LAYER_TEXTURED);
27 window->SetParent(NULL); 27 window->SetParent(NULL);
28 window->Show(); 28 window->Show();
29 29
30 Shell* shell = Shell::GetInstance(); 30 Shell* shell = Shell::GetInstance();
31 // If the auto-hide behavior isn't DEFAULT, the rest of the tests don't make 31 // If the auto-hide behavior isn't DEFAULT, the rest of the tests don't make
32 // sense. 32 // sense.
33 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT, 33 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT,
34 shell->GetShelfAutoHideBehavior()); 34 shell->GetShelfAutoHideBehavior());
35 EXPECT_FALSE(LauncherContextMenu::IsAutoHideMenuHideChecked()); 35 EXPECT_FALSE(LauncherContextMenu::IsAutoHideMenuHideChecked());
36 LauncherContextMenu::ToggleAutoHideMenu(); 36 shell->SetShelfAutoHideBehavior(
37 LauncherContextMenu::GetToggledAutoHideBehavior());
37 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, 38 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
38 shell->GetShelfAutoHideBehavior()); 39 shell->GetShelfAutoHideBehavior());
39 LauncherContextMenu::ToggleAutoHideMenu(); 40 shell->SetShelfAutoHideBehavior(
41 LauncherContextMenu::GetToggledAutoHideBehavior());
40 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT, 42 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT,
41 shell->GetShelfAutoHideBehavior()); 43 shell->GetShelfAutoHideBehavior());
42 44
43 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); 45 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
44 EXPECT_TRUE(LauncherContextMenu::IsAutoHideMenuHideChecked()); 46 EXPECT_TRUE(LauncherContextMenu::IsAutoHideMenuHideChecked());
45 LauncherContextMenu::ToggleAutoHideMenu(); 47 shell->SetShelfAutoHideBehavior(
48 LauncherContextMenu::GetToggledAutoHideBehavior());
46 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER, 49 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER,
47 shell->GetShelfAutoHideBehavior()); 50 shell->GetShelfAutoHideBehavior());
48 LauncherContextMenu::ToggleAutoHideMenu(); 51 shell->SetShelfAutoHideBehavior(
52 LauncherContextMenu::GetToggledAutoHideBehavior());
49 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT, 53 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT,
50 shell->GetShelfAutoHideBehavior()); 54 shell->GetShelfAutoHideBehavior());
51 } 55 }
52 56
53 } // namespace ash 57 } // namespace ash
OLDNEW
« no previous file with comments | « ash/launcher/launcher_context_menu.cc ('k') | chrome/browser/ui/views/ash/launcher/launcher_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698