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