summaryrefslogtreecommitdiffstats
path: root/ash/shell_unittest.cc
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-23 00:38:33 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-23 00:38:33 +0000
commit431552ca5af1f9d2cb09994e1d75e1d7f30cf002 (patch)
tree545584aa7c60c78021fa18e38c04c20fb248c31d /ash/shell_unittest.cc
parent1cca163c30823ea0531b9a84ddeb5a136c0927ad (diff)
downloadchromium_src-431552ca5af1f9d2cb09994e1d75e1d7f30cf002.zip
chromium_src-431552ca5af1f9d2cb09994e1d75e1d7f30cf002.tar.gz
chromium_src-431552ca5af1f9d2cb09994e1d75e1d7f30cf002.tar.bz2
Context menu for multiple launchers
- move the code to create/open context menu from launcher to root window controller. - updated methods that access shelf/launcher state to take root window so that menu can specify on which display it is working on. BUG=145978, 155776 TEST=none Review URL: https://chromiumcodereview.appspot.com/11198078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163459 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell_unittest.cc')
-rw-r--r--ash/shell_unittest.cc36
1 files changed, 36 insertions, 0 deletions
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index d939cdb..d9f1eb5 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -16,6 +16,7 @@
#include "ash/test/ash_test_base.h"
#include "ash/wm/root_window_layout_manager.h"
#include "ash/wm/shelf_layout_manager.h"
+#include "ash/wm/window_util.h"
#include "base/utf_string_conversions.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
@@ -391,6 +392,41 @@ TEST_F(ShellTest, SystemBackgroundBehindDesktopBackground) {
"system background and desktop background need to have a common parent";
}
+// Various assertions around IsAutoHideMenuHideChecked() and
+// ToggleAutoHideMenu().
+TEST_F(ShellTest, ToggleAutoHide) {
+ scoped_ptr<aura::Window> window(new aura::Window(NULL));
+ window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
+ window->SetType(aura::client::WINDOW_TYPE_NORMAL);
+ window->Init(ui::LAYER_TEXTURED);
+ window->SetParent(NULL);
+ window->Show();
+ wm::ActivateWindow(window.get());
+
+ internal::RootWindowController* controller =
+ Shell::GetPrimaryRootWindowController();
+ controller->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
+ controller->GetShelfAutoHideBehavior());
+ EXPECT_TRUE(controller->IsShelfAutoHideMenuHideChecked());
+ controller->SetShelfAutoHideBehavior(
+ controller->GetToggledShelfAutoHideBehavior());
+ EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER,
+ controller->GetShelfAutoHideBehavior());
+
+ window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
+ EXPECT_FALSE(controller->IsShelfAutoHideMenuHideChecked());
+ controller->SetShelfAutoHideBehavior(
+ controller->GetToggledShelfAutoHideBehavior());
+ EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
+ controller->GetShelfAutoHideBehavior());
+ EXPECT_TRUE(controller->IsShelfAutoHideMenuHideChecked());
+ controller->SetShelfAutoHideBehavior(
+ controller->GetToggledShelfAutoHideBehavior());
+ EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER,
+ controller->GetShelfAutoHideBehavior());
+}
+
// This verifies WindowObservers are removed when a window is destroyed after
// the Shell is destroyed. This scenario (aura::Windows being deleted after the
// Shell) occurs if someone is holding a reference to an unparented Window, as