diff options
author | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-30 17:49:20 +0000 |
---|---|---|
committer | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-30 17:49:20 +0000 |
commit | 700849ffe63508dc0868271f257ada11bcdf2791 (patch) | |
tree | 95fe7b776d78e4a75108ac2515e2f69653ef7db1 /ash/root_window_controller_unittest.cc | |
parent | 982970e2cc90dba47e0cc264fea7a46988ddfd8b (diff) | |
download | chromium_src-700849ffe63508dc0868271f257ada11bcdf2791.zip chromium_src-700849ffe63508dc0868271f257ada11bcdf2791.tar.gz chromium_src-700849ffe63508dc0868271f257ada11bcdf2791.tar.bz2 |
Hide the tab indicators and the shelf when in immersive + tab fullscreen.
BUG=234447, 233271
Test=ImmersiveModeControllerAshTest.TabAndBrowserFullscreen,
RootWindowController.GetFullscreenWindow
Review URL: https://chromiumcodereview.appspot.com/14340007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197400 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/root_window_controller_unittest.cc')
-rw-r--r-- | ash/root_window_controller_unittest.cc | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc index c5bd68d..55b3ed2 100644 --- a/ash/root_window_controller_unittest.cc +++ b/ash/root_window_controller_unittest.cc @@ -372,31 +372,34 @@ 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) { +// Test that GetFullscreenWindow() returns a fullscreen window only if the +// fullscreen window is in the active workspace. +TEST_F(RootWindowControllerTest, GetFullscreenWindow) { UpdateDisplay("600x600"); internal::RootWindowController* controller = Shell::GetInstance()->GetPrimaryRootWindowController(); - // Open a maximized window. - Widget* w1 = CreateTestWidget(gfx::Rect(0, 1, 250, 251)); + Widget* w1 = CreateTestWidget(gfx::Rect(0, 0, 100, 100)); 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()); + Widget* w2 = CreateTestWidget(gfx::Rect(0, 0, 100, 100)); + w2->SetFullscreen(true); + // |w3| is a transient child of |w2|. + Widget* w3 = Widget::CreateWindowWithParentAndBounds(NULL, + w2->GetNativeWindow(), gfx::Rect(0, 0, 100, 100)); + + // Test that GetFullscreenWindow() finds the fullscreen window when one of + // its transient children is active. + w3->Activate(); + EXPECT_EQ(w2->GetNativeWindow(), controller->GetFullscreenWindow()); + + // Activate the maximized window's workspace. GetFullscreenWindow() should + // fail because the fullscreen window's workspace is no longer active. + w1->Activate(); + EXPECT_FALSE(controller->GetFullscreenWindow()); + + // If the fullscreen window is active, GetFullscreenWindow() should find it. + w2->Activate(); + EXPECT_EQ(w2->GetNativeWindow(), controller->GetFullscreenWindow()); } } // namespace test |