summaryrefslogtreecommitdiffstats
path: root/ash/root_window_controller_unittest.cc
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-10 23:37:16 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-10 23:37:16 +0000
commit2ee2f5db813d4f9ac9c129c67c3fb2b3c01ae999 (patch)
treea11e262fa33def6946ebc1cf0169b1668da65e74 /ash/root_window_controller_unittest.cc
parent8521c5c456550b9e46f85726d52ff51715cbfa36 (diff)
downloadchromium_src-2ee2f5db813d4f9ac9c129c67c3fb2b3c01ae999.zip
chromium_src-2ee2f5db813d4f9ac9c129c67c3fb2b3c01ae999.tar.gz
chromium_src-2ee2f5db813d4f9ac9c129c67c3fb2b3c01ae999.tar.bz2
ash/immersive mode: Hide the launcher when entering immersive mode
* Set shelf to auto-hide when enabling immersive mode * Directly access ash::Shell for auto-hide so we don't overwrite the user's preferences BUG=168592 TEST=added to browser_tests ImmersiveModeController Review URL: https://chromiumcodereview.appspot.com/11830008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176206 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/root_window_controller_unittest.cc')
-rw-r--r--ash/root_window_controller_unittest.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index 8dac9d3..54aa82d 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -11,6 +11,7 @@
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/system_modal_container_layout_manager.h"
+#include "ash/wm/window_properties.h"
#include "ash/wm/window_util.h"
#include "ui/aura/client/focus_change_observer.h"
#include "ui/aura/client/focus_client.h"
@@ -25,6 +26,9 @@
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
+using aura::Window;
+using views::Widget;
+
namespace ash {
namespace {
@@ -319,5 +323,32 @@ TEST_F(RootWindowControllerTest, ModalContainerNotLoggedInLoggedIn) {
session_modal_widget->GetNativeView()));
}
+// Ensure a workspace with two windows reports immersive mode even if only
+// one has the property set.
+TEST_F(RootWindowControllerTest, ImmersiveMode) {
+ UpdateDisplay("600x600");
+ internal::RootWindowController* controller =
+ Shell::GetInstance()->GetPrimaryRootWindowController();
+
+ // Open a maximized window.
+ Widget* w1 = CreateTestWidget(gfx::Rect(0, 1, 250, 251));
+ w1->Maximize();
+
+ // Immersive mode off by default.
+ EXPECT_FALSE(controller->IsImmersiveMode());
+
+ // Enter immersive mode.
+ w1->GetNativeWindow()->SetProperty(ash::internal::kImmersiveModeKey, true);
+ EXPECT_TRUE(controller->IsImmersiveMode());
+
+ // Add a child, like a print window. Still in immersive mode.
+ Widget* w2 =
+ Widget::CreateWindowWithParentAndBounds(NULL,
+ w1->GetNativeWindow(),
+ gfx::Rect(0, 1, 150, 151));
+ w2->Show();
+ EXPECT_TRUE(controller->IsImmersiveMode());
+}
+
} // namespace test
} // namespace ash