OLD | NEW |
---|---|
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/wm/immersive_fullscreen_controller.h" | 5 #include "ash/wm/immersive_fullscreen_controller.h" |
6 | 6 |
7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
8 #include "ash/display/mouse_cursor_event_filter.h" | 8 #include "ash/display/mouse_cursor_event_filter.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
11 #include "ash/shelf/shelf_types.h" | 11 #include "ash/shelf/shelf_types.h" |
12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
13 #include "ash/test/ash_test_base.h" | 13 #include "ash/test/ash_test_base.h" |
14 #include "ash/wm/window_state.h" | |
14 #include "ui/aura/client/aura_constants.h" | 15 #include "ui/aura/client/aura_constants.h" |
15 #include "ui/aura/client/cursor_client.h" | 16 #include "ui/aura/client/cursor_client.h" |
16 #include "ui/aura/env.h" | 17 #include "ui/aura/env.h" |
17 #include "ui/aura/test/event_generator.h" | 18 #include "ui/aura/test/event_generator.h" |
18 #include "ui/aura/test/test_window_delegate.h" | 19 #include "ui/aura/test/test_window_delegate.h" |
19 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
20 #include "ui/aura/window_event_dispatcher.h" | 21 #include "ui/aura/window_event_dispatcher.h" |
21 #include "ui/events/event_utils.h" | 22 #include "ui/events/event_utils.h" |
22 #include "ui/events/test/test_event_handler.h" | 23 #include "ui/events/test/test_event_handler.h" |
23 #include "ui/gfx/animation/slide_animation.h" | 24 #include "ui/gfx/animation/slide_animation.h" |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
772 EXPECT_FALSE(controller()->IsRevealed()); | 773 EXPECT_FALSE(controller()->IsRevealed()); |
773 // Make sure the windows are still aligned on top. | 774 // Make sure the windows are still aligned on top. |
774 EXPECT_EQ(behind->GetBoundsInScreen().y(), window()->GetBoundsInScreen().y()); | 775 EXPECT_EQ(behind->GetBoundsInScreen().y(), window()->GetBoundsInScreen().y()); |
775 top = behind->GetBoundsInScreen().y(); | 776 top = behind->GetBoundsInScreen().y(); |
776 ui::TouchEvent touch2(ui::ET_TOUCH_MOVED, gfx::Point(10, top), 0, | 777 ui::TouchEvent touch2(ui::ET_TOUCH_MOVED, gfx::Point(10, top), 0, |
777 ui::EventTimeForNow()); | 778 ui::EventTimeForNow()); |
778 // The event should still be targeted to window(). | 779 // The event should still be targeted to window(). |
779 EXPECT_EQ(window(), targeter->FindTargetForEvent(root, &touch2)); | 780 EXPECT_EQ(window(), targeter->FindTargetForEvent(root, &touch2)); |
780 } | 781 } |
781 | 782 |
783 // Check that the window state gets properly marked for immersive mode. | |
pkotwicz
2014/06/02 22:27:58
Nit: immersive mode -> immersive fullscreen
Mr4D (OOO till 08-26)
2014/06/03 14:36:40
Somehow that is odd since there are several files
| |
784 TEST_F(ImmersiveFullscreenControllerTest, WindowStateImmersiveModeFullscreen) { | |
785 ash::wm::WindowState* window_state = ash::wm::GetWindowState(window()); | |
786 | |
787 EXPECT_FALSE(window_state->in_immersive_fullscreen()); | |
788 SetEnabled(true); | |
789 ASSERT_TRUE(controller()->IsEnabled()); | |
790 EXPECT_TRUE(window_state->in_immersive_fullscreen()); | |
791 | |
792 SetEnabled(false); | |
793 ASSERT_FALSE(controller()->IsEnabled()); | |
794 EXPECT_FALSE(window_state->in_immersive_fullscreen()); | |
795 } | |
796 | |
782 // Do not test under windows because focus testing is not reliable on | 797 // Do not test under windows because focus testing is not reliable on |
783 // Windows. (crbug.com/79493) | 798 // Windows. (crbug.com/79493) |
784 #if !defined(OS_WIN) | 799 #if !defined(OS_WIN) |
785 | 800 |
786 // Test how focus and activation affects whether the top-of-window views are | 801 // Test how focus and activation affects whether the top-of-window views are |
787 // revealed. | 802 // revealed. |
788 TEST_F(ImmersiveFullscreenControllerTest, Focus) { | 803 TEST_F(ImmersiveFullscreenControllerTest, Focus) { |
789 // Add views to the view hierarchy which we will focus and unfocus during the | 804 // Add views to the view hierarchy which we will focus and unfocus during the |
790 // test. | 805 // test. |
791 views::View* child_view = new views::View(); | 806 views::View* child_view = new views::View(); |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1053 EXPECT_EQ(ash::SHELF_AUTO_HIDE, shelf->visibility_state()); | 1068 EXPECT_EQ(ash::SHELF_AUTO_HIDE, shelf->visibility_state()); |
1054 | 1069 |
1055 // Disabling immersive fullscreen maintains the user's auto-hide selection. | 1070 // Disabling immersive fullscreen maintains the user's auto-hide selection. |
1056 SetEnabled(false); | 1071 SetEnabled(false); |
1057 window()->SetProperty(aura::client::kShowStateKey, | 1072 window()->SetProperty(aura::client::kShowStateKey, |
1058 ui::SHOW_STATE_NORMAL); | 1073 ui::SHOW_STATE_NORMAL); |
1059 EXPECT_EQ(ash::SHELF_AUTO_HIDE, shelf->visibility_state()); | 1074 EXPECT_EQ(ash::SHELF_AUTO_HIDE, shelf->visibility_state()); |
1060 } | 1075 } |
1061 | 1076 |
1062 } // namespase ash | 1077 } // namespase ash |
OLD | NEW |