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

Side by Side Diff: ash/wm/immersive_fullscreen_controller_unittest.cc

Issue 2272793005: ash: Move alignment and autohide behavior from Shelf to WmShelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/shared/immersive_fullscreen_controller.h" 5 #include "ash/shared/immersive_fullscreen_controller.h"
6 6
7 #include "ash/common/shelf/shelf.h"
8 #include "ash/common/shelf/shelf_types.h" 7 #include "ash/common/shelf/shelf_types.h"
8 #include "ash/common/shelf/wm_shelf.h"
9 #include "ash/common/wm/window_state.h" 9 #include "ash/common/wm/window_state.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
11 #include "ash/display/mouse_cursor_event_filter.h" 11 #include "ash/display/mouse_cursor_event_filter.h"
12 #include "ash/root_window_controller.h" 12 #include "ash/root_window_controller.h"
13 #include "ash/shared/immersive_fullscreen_controller_delegate.h" 13 #include "ash/shared/immersive_fullscreen_controller_delegate.h"
14 #include "ash/shell.h" 14 #include "ash/shell.h"
15 #include "ash/test/ash_test_base.h" 15 #include "ash/test/ash_test_base.h"
16 #include "ash/test/display_manager_test_api.h" 16 #include "ash/test/display_manager_test_api.h"
17 #include "ash/test/immersive_fullscreen_controller_test_api.h" 17 #include "ash/test/immersive_fullscreen_controller_test_api.h"
18 #include "ash/wm/window_state_aura.h" 18 #include "ash/wm/window_state_aura.h"
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 EXPECT_FALSE(controller()->IsRevealed()); 1014 EXPECT_FALSE(controller()->IsRevealed());
1015 bubble_widget8->Close(); 1015 bubble_widget8->Close();
1016 } 1016 }
1017 1017
1018 #endif // defined(OS_WIN) 1018 #endif // defined(OS_WIN)
1019 1019
1020 // Test that the shelf is set to auto hide as long as the window is in 1020 // Test that the shelf is set to auto hide as long as the window is in
1021 // immersive fullscreen and that the shelf's state before entering immersive 1021 // immersive fullscreen and that the shelf's state before entering immersive
1022 // fullscreen is restored upon exiting immersive fullscreen. 1022 // fullscreen is restored upon exiting immersive fullscreen.
1023 TEST_F(ImmersiveFullscreenControllerTest, Shelf) { 1023 TEST_F(ImmersiveFullscreenControllerTest, Shelf) {
1024 Shelf* shelf = Shelf::ForPrimaryDisplay(); 1024 WmShelf* shelf = GetPrimaryShelf();
1025 1025
1026 // Shelf is visible by default. 1026 // Shelf is visible by default.
1027 window()->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); 1027 window()->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
1028 ASSERT_FALSE(controller()->IsEnabled()); 1028 ASSERT_FALSE(controller()->IsEnabled());
1029 ASSERT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState()); 1029 ASSERT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState());
1030 1030
1031 // Entering immersive fullscreen sets the shelf to auto hide. 1031 // Entering immersive fullscreen sets the shelf to auto hide.
1032 window()->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); 1032 window()->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
1033 SetEnabled(true); 1033 SetEnabled(true);
1034 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); 1034 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
(...skipping 13 matching lines...) Expand all
1048 SetEnabled(true); 1048 SetEnabled(true);
1049 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); 1049 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
1050 1050
1051 // Disabling immersive fullscreen maintains the user's auto-hide selection. 1051 // Disabling immersive fullscreen maintains the user's auto-hide selection.
1052 SetEnabled(false); 1052 SetEnabled(false);
1053 window()->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); 1053 window()->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
1054 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); 1054 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
1055 } 1055 }
1056 1056
1057 } // namespase ash 1057 } // namespase ash
OLDNEW
« no previous file with comments | « ash/wm/dock/docked_window_resizer_unittest.cc ('k') | ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698