| 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 "ash/wm/window_state.h" | 7 #include "ash/wm/window_state.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1496 } | 1496 } |
| 1497 | 1497 |
| 1498 } // namespace | 1498 } // namespace |
| 1499 | 1499 |
| 1500 #if defined(OS_CHROMEOS) | 1500 #if defined(OS_CHROMEOS) |
| 1501 // TODO(sky,sad): Disabled as it fails due to resize locks with a real | 1501 // TODO(sky,sad): Disabled as it fails due to resize locks with a real |
| 1502 // compositor. crbug.com/331924 | 1502 // compositor. crbug.com/331924 |
| 1503 #define MAYBE_DragSingleTabToSeparateWindowInSecondDisplay \ | 1503 #define MAYBE_DragSingleTabToSeparateWindowInSecondDisplay \ |
| 1504 DISABLED_DragSingleTabToSeparateWindowInSecondDisplay | 1504 DISABLED_DragSingleTabToSeparateWindowInSecondDisplay |
| 1505 #else | 1505 #else |
| 1506 #define MAYBE_DragSingleTabToSeparateWindow \ | 1506 #define MAYBE_DragSingleTabToSeparateWindowInSecondDisplay \ |
| 1507 DragSingleTabToSeparateWindowInSecondDisplay | 1507 DragSingleTabToSeparateWindowInSecondDisplay |
| 1508 #endif | 1508 #endif |
| 1509 // Drags from browser to a second display and releases input. | 1509 // Drags from browser to a second display and releases input. |
| 1510 IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest, | 1510 IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest, |
| 1511 MAYBE_DragSingleTabToSeparateWindowInSecondDisplay) { | 1511 MAYBE_DragSingleTabToSeparateWindowInSecondDisplay) { |
| 1512 // Add another tab. | 1512 // Add another tab. |
| 1513 AddTabAndResetBrowser(browser()); | 1513 AddTabAndResetBrowser(browser()); |
| 1514 TabStrip* tab_strip = GetTabStripForBrowser(browser()); | 1514 TabStrip* tab_strip = GetTabStripForBrowser(browser()); |
| 1515 | 1515 |
| 1516 // Move to the first tab and drag it enough so that it detaches. | 1516 // Move to the first tab and drag it enough so that it detaches. |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2040 new_browser->window()->GetNativeWindow()->GetRootWindow()); | 2040 new_browser->window()->GetNativeWindow()->GetRootWindow()); |
| 2041 | 2041 |
| 2042 ASSERT_TRUE(test->DragTabAndExecuteTaskWhenDone( | 2042 ASSERT_TRUE(test->DragTabAndExecuteTaskWhenDone( |
| 2043 final_destination, | 2043 final_destination, |
| 2044 base::Bind(&CancelDragTabToWindowInSeparateDisplayStep3, | 2044 base::Bind(&CancelDragTabToWindowInSeparateDisplayStep3, |
| 2045 tab_strip, browser_list))); | 2045 tab_strip, browser_list))); |
| 2046 } | 2046 } |
| 2047 | 2047 |
| 2048 } // namespace | 2048 } // namespace |
| 2049 | 2049 |
| 2050 #if defined(OS_CHROMEOS) | 2050 #if defined(OS_CHROMEOS) || defined(OS_LINUX) |
| 2051 // TODO(sky,sad): Disabled as it fails due to resize locks with a real | 2051 // TODO(sky,sad): Disabled as it fails due to resize locks with a real |
| 2052 // compositor. crbug.com/331924 | 2052 // compositor. crbug.com/331924 |
| 2053 #define MAYBE_CancelDragTabToWindowIn2ndDisplay \ | 2053 #define MAYBE_CancelDragTabToWindowIn2ndDisplay \ |
| 2054 DISABLED_CancelDragTabToWindowIn2ndDisplay | 2054 DISABLED_CancelDragTabToWindowIn2ndDisplay |
| 2055 #else | 2055 #else |
| 2056 #define MAYBE_CancelDragTabToWindowIn2ndDisplay \ | 2056 #define MAYBE_CancelDragTabToWindowIn2ndDisplay \ |
| 2057 CancelDragTabToWindowIn2ndDisplay | 2057 CancelDragTabToWindowIn2ndDisplay |
| 2058 #endif | 2058 #endif |
| 2059 // Drags from browser to a second display and releases input. | 2059 // Drags from browser to a second display and releases input. |
| 2060 IN_PROC_BROWSER_TEST_F( | 2060 IN_PROC_BROWSER_TEST_F( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 2087 ASSERT_EQ(1u, native_browser_list->size()); | 2087 ASSERT_EQ(1u, native_browser_list->size()); |
| 2088 ASSERT_FALSE(tab_strip->IsDragSessionActive()); | 2088 ASSERT_FALSE(tab_strip->IsDragSessionActive()); |
| 2089 ASSERT_FALSE(TabDragController::IsActive()); | 2089 ASSERT_FALSE(TabDragController::IsActive()); |
| 2090 EXPECT_EQ("0 1", IDString(browser()->tab_strip_model())); | 2090 EXPECT_EQ("0 1", IDString(browser()->tab_strip_model())); |
| 2091 | 2091 |
| 2092 // Release the mouse | 2092 // Release the mouse |
| 2093 ASSERT_TRUE(ui_test_utils::SendMouseEventsSync( | 2093 ASSERT_TRUE(ui_test_utils::SendMouseEventsSync( |
| 2094 ui_controls::LEFT, ui_controls::UP)); | 2094 ui_controls::LEFT, ui_controls::UP)); |
| 2095 } | 2095 } |
| 2096 | 2096 |
| 2097 #if defined(OS_CHROMEOS) | 2097 #if defined(OS_CHROMEOS) || defined(OS_LINUX) |
| 2098 // TODO(sky,sad): Disabled as it fails due to resize locks with a real | 2098 // TODO(sky,sad): Disabled as it fails due to resize locks with a real |
| 2099 // compositor. crbug.com/331924 | 2099 // compositor. crbug.com/331924 |
| 2100 #define MAYBE_CancelDragTabToWindowIn1stDisplay \ | 2100 #define MAYBE_CancelDragTabToWindowIn1stDisplay \ |
| 2101 DISABLED_CancelDragTabToWindowIn1stDisplay | 2101 DISABLED_CancelDragTabToWindowIn1stDisplay |
| 2102 #else | 2102 #else |
| 2103 #define MAYBE_CancelDragTabToWindowIn1stDisplay \ | 2103 #define MAYBE_CancelDragTabToWindowIn1stDisplay \ |
| 2104 CancelDragTabToWindowIn1stDisplay | 2104 CancelDragTabToWindowIn1stDisplay |
| 2105 #endif | 2105 #endif |
| 2106 // Drags from browser from a second display to primary and releases input. | 2106 // Drags from browser from a second display to primary and releases input. |
| 2107 IN_PROC_BROWSER_TEST_F( | 2107 IN_PROC_BROWSER_TEST_F( |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2311 } else { | 2311 } else { |
| 2312 // The new window should be snapped and not docked if docking is disabled. | 2312 // The new window should be snapped and not docked if docking is disabled. |
| 2313 EXPECT_FALSE(window_state->IsDocked()); | 2313 EXPECT_FALSE(window_state->IsDocked()); |
| 2314 EXPECT_TRUE(window_state->IsSnapped()); | 2314 EXPECT_TRUE(window_state->IsSnapped()); |
| 2315 } | 2315 } |
| 2316 } | 2316 } |
| 2317 | 2317 |
| 2318 | 2318 |
| 2319 #endif | 2319 #endif |
| 2320 | 2320 |
| 2321 #if defined(USE_ASH) && !defined(OS_WIN) // TODO(win_ash) | 2321 #if defined(USE_ASH) && defined(OS_CHROMEOS) // TODO(win_ash,linux_ash) |
| 2322 INSTANTIATE_TEST_CASE_P(TabDragging, | 2322 INSTANTIATE_TEST_CASE_P(TabDragging, |
| 2323 DetachToBrowserInSeparateDisplayTabDragControllerTest, | 2323 DetachToBrowserInSeparateDisplayTabDragControllerTest, |
| 2324 ::testing::Values("mouse", "touch")); | 2324 ::testing::Values("mouse", "touch")); |
| 2325 INSTANTIATE_TEST_CASE_P(TabDragging, | 2325 INSTANTIATE_TEST_CASE_P(TabDragging, |
| 2326 DifferentDeviceScaleFactorDisplayTabDragControllerTest, | 2326 DifferentDeviceScaleFactorDisplayTabDragControllerTest, |
| 2327 ::testing::Values("mouse")); | 2327 ::testing::Values("mouse")); |
| 2328 INSTANTIATE_TEST_CASE_P(TabDragging, | 2328 INSTANTIATE_TEST_CASE_P(TabDragging, |
| 2329 DetachToBrowserTabDragControllerTest, | 2329 DetachToBrowserTabDragControllerTest, |
| 2330 ::testing::Values("mouse", "touch")); | 2330 ::testing::Values("mouse", "touch")); |
| 2331 INSTANTIATE_TEST_CASE_P(TabDragging, | 2331 INSTANTIATE_TEST_CASE_P(TabDragging, |
| 2332 DetachToDockedTabDragControllerTest, | 2332 DetachToDockedTabDragControllerTest, |
| 2333 ::testing::Values("mouse", "mouse docked")); | 2333 ::testing::Values("mouse", "mouse docked")); |
| 2334 INSTANTIATE_TEST_CASE_P(TabDragging, | 2334 INSTANTIATE_TEST_CASE_P(TabDragging, |
| 2335 DetachToBrowserTabDragControllerTestTouch, | 2335 DetachToBrowserTabDragControllerTestTouch, |
| 2336 ::testing::Values("touch", "touch docked")); | 2336 ::testing::Values("touch", "touch docked")); |
| 2337 #else | 2337 #elif defined(USE_ASH) && !defined(OS_LINUX) // TODO(linux_ash) |
| 2338 INSTANTIATE_TEST_CASE_P(TabDragging, | 2338 INSTANTIATE_TEST_CASE_P(TabDragging, |
| 2339 DetachToBrowserTabDragControllerTest, | 2339 DetachToBrowserTabDragControllerTest, |
| 2340 ::testing::Values("mouse")); | 2340 ::testing::Values("mouse")); |
| 2341 #endif | 2341 #endif |
| OLD | NEW |