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

Unified Diff: ash/root_window_controller_unittest.cc

Issue 11830008: ash/immersive mode: Hide the launcher when entering immersive mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move logic to RootWindowController Created 7 years, 11 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/root_window_controller.cc ('k') | ash/wm/shelf_layout_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/root_window_controller_unittest.cc
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index 8dac9d32d66c0b0ba1d2efb87cb820280d7f6a76..54aa82d37847781bf420def6b110a7b9d475c893 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
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/wm/shelf_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698