| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 336 |
| 337 IN_PROC_BROWSER_TEST_F(TabDragControllerTest, GestureEndShouldEndDragTest) { | 337 IN_PROC_BROWSER_TEST_F(TabDragControllerTest, GestureEndShouldEndDragTest) { |
| 338 AddTabAndResetBrowser(browser()); | 338 AddTabAndResetBrowser(browser()); |
| 339 | 339 |
| 340 TabStrip* tab_strip = GetTabStripForBrowser(browser()); | 340 TabStrip* tab_strip = GetTabStripForBrowser(browser()); |
| 341 | 341 |
| 342 Tab* tab1 = tab_strip->tab_at(1); | 342 Tab* tab1 = tab_strip->tab_at(1); |
| 343 gfx::Point tab_1_center(tab1->width() / 2, tab1->height() / 2); | 343 gfx::Point tab_1_center(tab1->width() / 2, tab1->height() / 2); |
| 344 | 344 |
| 345 ui::GestureEvent gesture_tap_down( | 345 ui::GestureEvent gesture_tap_down( |
| 346 tab_1_center.x(), | 346 tab_1_center.x(), tab_1_center.x(), 0, base::TimeTicks(), |
| 347 tab_1_center.x(), | |
| 348 0, | |
| 349 base::TimeDelta(), | |
| 350 ui::GestureEventDetails(ui::ET_GESTURE_TAP_DOWN)); | 347 ui::GestureEventDetails(ui::ET_GESTURE_TAP_DOWN)); |
| 351 tab_strip->MaybeStartDrag(tab1, gesture_tap_down, | 348 tab_strip->MaybeStartDrag(tab1, gesture_tap_down, |
| 352 tab_strip->GetSelectionModel()); | 349 tab_strip->GetSelectionModel()); |
| 353 EXPECT_TRUE(TabDragController::IsActive()); | 350 EXPECT_TRUE(TabDragController::IsActive()); |
| 354 | 351 |
| 355 ui::GestureEvent gesture_end(tab_1_center.x(), | 352 ui::GestureEvent gesture_end(tab_1_center.x(), tab_1_center.x(), 0, |
| 356 tab_1_center.x(), | 353 base::TimeTicks(), |
| 357 0, | |
| 358 base::TimeDelta(), | |
| 359 ui::GestureEventDetails(ui::ET_GESTURE_END)); | 354 ui::GestureEventDetails(ui::ET_GESTURE_END)); |
| 360 tab_strip->OnGestureEvent(&gesture_end); | 355 tab_strip->OnGestureEvent(&gesture_end); |
| 361 EXPECT_FALSE(TabDragController::IsActive()); | 356 EXPECT_FALSE(TabDragController::IsActive()); |
| 362 EXPECT_FALSE(tab_strip->IsDragSessionActive()); | 357 EXPECT_FALSE(tab_strip->IsDragSessionActive()); |
| 363 } | 358 } |
| 364 | 359 |
| 365 #endif | 360 #endif |
| 366 | 361 |
| 367 class DetachToBrowserTabDragControllerTest | 362 class DetachToBrowserTabDragControllerTest |
| 368 : public TabDragControllerTest, | 363 : public TabDragControllerTest, |
| (...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2472 DetachToBrowserTabDragControllerTest, | 2467 DetachToBrowserTabDragControllerTest, |
| 2473 ::testing::Values("mouse", "touch")); | 2468 ::testing::Values("mouse", "touch")); |
| 2474 INSTANTIATE_TEST_CASE_P(TabDragging, | 2469 INSTANTIATE_TEST_CASE_P(TabDragging, |
| 2475 DetachToBrowserTabDragControllerTestTouch, | 2470 DetachToBrowserTabDragControllerTestTouch, |
| 2476 ::testing::Values("touch")); | 2471 ::testing::Values("touch")); |
| 2477 #else | 2472 #else |
| 2478 INSTANTIATE_TEST_CASE_P(TabDragging, | 2473 INSTANTIATE_TEST_CASE_P(TabDragging, |
| 2479 DetachToBrowserTabDragControllerTest, | 2474 DetachToBrowserTabDragControllerTest, |
| 2480 ::testing::Values("mouse")); | 2475 ::testing::Values("mouse")); |
| 2481 #endif | 2476 #endif |
| OLD | NEW |