| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.h" | 5 #include "chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 58 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 59 #endif | 59 #endif |
| 60 | 60 |
| 61 #if defined(USE_ASH) | 61 #if defined(USE_ASH) |
| 62 #include "ash/aura/wm_window_aura.h" | 62 #include "ash/aura/wm_window_aura.h" |
| 63 #include "ash/common/wm/root_window_finder.h" | 63 #include "ash/common/wm/root_window_finder.h" |
| 64 #include "ash/common/wm/window_state.h" | 64 #include "ash/common/wm/window_state.h" |
| 65 #include "ash/display/display_manager.h" | 65 #include "ash/display/display_manager.h" |
| 66 #include "ash/shell.h" | 66 #include "ash/shell.h" |
| 67 #include "ash/test/cursor_manager_test_api.h" | 67 #include "ash/test/cursor_manager_test_api.h" |
| 68 #include "ash/test/immersive_fullscreen_controller_test_api.h" |
| 68 #include "ash/wm/window_state_aura.h" | 69 #include "ash/wm/window_state_aura.h" |
| 69 #include "ash/wm/window_util.h" | 70 #include "ash/wm/window_util.h" |
| 70 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" | 71 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
| 72 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" |
| 71 #include "ui/aura/client/screen_position_client.h" | 73 #include "ui/aura/client/screen_position_client.h" |
| 72 #include "ui/aura/test/event_generator_delegate_aura.h" | 74 #include "ui/aura/test/event_generator_delegate_aura.h" |
| 73 #include "ui/aura/window_event_dispatcher.h" | 75 #include "ui/aura/window_event_dispatcher.h" |
| 74 #include "ui/events/test/event_generator.h" | 76 #include "ui/events/test/event_generator.h" |
| 75 #endif | 77 #endif |
| 76 | 78 |
| 77 using content::WebContents; | 79 using content::WebContents; |
| 78 | 80 |
| 79 namespace test { | 81 namespace test { |
| 80 | 82 |
| (...skipping 1959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2040 ->GetDisplayNearestWindow(second_root) | 2042 ->GetDisplayNearestWindow(second_root) |
| 2041 .work_area(); | 2043 .work_area(); |
| 2042 browser2->window()->SetBounds(work_area); | 2044 browser2->window()->SetBounds(work_area); |
| 2043 EXPECT_EQ(second_root, | 2045 EXPECT_EQ(second_root, |
| 2044 browser2->window()->GetNativeWindow()->GetRootWindow()); | 2046 browser2->window()->GetNativeWindow()->GetRootWindow()); |
| 2045 | 2047 |
| 2046 // Put the second browser into immersive fullscreen. | 2048 // Put the second browser into immersive fullscreen. |
| 2047 BrowserView* browser_view2 = BrowserView::GetBrowserViewForBrowser(browser2); | 2049 BrowserView* browser_view2 = BrowserView::GetBrowserViewForBrowser(browser2); |
| 2048 ImmersiveModeController* immersive_controller2 = | 2050 ImmersiveModeController* immersive_controller2 = |
| 2049 browser_view2->immersive_mode_controller(); | 2051 browser_view2->immersive_mode_controller(); |
| 2050 immersive_controller2->SetupForTest(); | 2052 ASSERT_EQ(ImmersiveModeController::Type::ASH, immersive_controller2->type()); |
| 2053 ash::ImmersiveFullscreenControllerTestApi( |
| 2054 static_cast<ImmersiveModeControllerAsh*>(immersive_controller2) |
| 2055 ->controller()) |
| 2056 .SetupForTest(); |
| 2051 chrome::ToggleFullscreenMode(browser2); | 2057 chrome::ToggleFullscreenMode(browser2); |
| 2052 ASSERT_TRUE(immersive_controller2->IsEnabled()); | 2058 ASSERT_TRUE(immersive_controller2->IsEnabled()); |
| 2053 ASSERT_FALSE(immersive_controller2->IsRevealed()); | 2059 ASSERT_FALSE(immersive_controller2->IsRevealed()); |
| 2054 ASSERT_TRUE(tab_strip2->IsImmersiveStyle()); | 2060 ASSERT_TRUE(tab_strip2->IsImmersiveStyle()); |
| 2055 | 2061 |
| 2056 // Move to the first tab and drag it enough so that it detaches, but not | 2062 // Move to the first tab and drag it enough so that it detaches, but not |
| 2057 // enough that it attaches to browser2. | 2063 // enough that it attaches to browser2. |
| 2058 gfx::Point tab_0_center(GetCenterInScreenCoordinates(tab_strip->tab_at(0))); | 2064 gfx::Point tab_0_center(GetCenterInScreenCoordinates(tab_strip->tab_at(0))); |
| 2059 ASSERT_TRUE(PressInput(tab_0_center)); | 2065 ASSERT_TRUE(PressInput(tab_0_center)); |
| 2060 ASSERT_TRUE(DragInputToNotifyWhenDone( | 2066 ASSERT_TRUE(DragInputToNotifyWhenDone( |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2495 DetachToBrowserTabDragControllerTest, | 2501 DetachToBrowserTabDragControllerTest, |
| 2496 ::testing::Values("mouse", "touch")); | 2502 ::testing::Values("mouse", "touch")); |
| 2497 INSTANTIATE_TEST_CASE_P(TabDragging, | 2503 INSTANTIATE_TEST_CASE_P(TabDragging, |
| 2498 DetachToBrowserTabDragControllerTestTouch, | 2504 DetachToBrowserTabDragControllerTestTouch, |
| 2499 ::testing::Values("touch")); | 2505 ::testing::Values("touch")); |
| 2500 #else | 2506 #else |
| 2501 INSTANTIATE_TEST_CASE_P(TabDragging, | 2507 INSTANTIATE_TEST_CASE_P(TabDragging, |
| 2502 DetachToBrowserTabDragControllerTest, | 2508 DetachToBrowserTabDragControllerTest, |
| 2503 ::testing::Values("mouse")); | 2509 ::testing::Values("mouse")); |
| 2504 #endif | 2510 #endif |
| OLD | NEW |