| 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 bool ReleaseMouseAsync() { | 525 bool ReleaseMouseAsync() { |
| 526 return input_source() == INPUT_SOURCE_MOUSE && | 526 return input_source() == INPUT_SOURCE_MOUSE && |
| 527 ui_controls::SendMouseEvents(ui_controls::LEFT, ui_controls::UP); | 527 ui_controls::SendMouseEvents(ui_controls::LEFT, ui_controls::UP); |
| 528 } | 528 } |
| 529 | 529 |
| 530 void QuitWhenNotDragging() { | 530 void QuitWhenNotDragging() { |
| 531 if (input_source() == INPUT_SOURCE_MOUSE) { | 531 if (input_source() == INPUT_SOURCE_MOUSE) { |
| 532 // Schedule observer to quit message loop when done dragging. This has to | 532 // Schedule observer to quit message loop when done dragging. This has to |
| 533 // be async so the message loop can run. | 533 // be async so the message loop can run. |
| 534 test::QuitWhenNotDraggingImpl(); | 534 test::QuitWhenNotDraggingImpl(); |
| 535 base::MessageLoop::current()->Run(); | 535 base::RunLoop().Run(); |
| 536 } else { | 536 } else { |
| 537 // Touch events are sync, so we know we're not in a drag session. But some | 537 // Touch events are sync, so we know we're not in a drag session. But some |
| 538 // tests rely on the browser fully closing, which is async. So, run all | 538 // tests rely on the browser fully closing, which is async. So, run all |
| 539 // pending tasks. | 539 // pending tasks. |
| 540 base::RunLoop run_loop; | 540 base::RunLoop run_loop; |
| 541 run_loop.RunUntilIdle(); | 541 run_loop.RunUntilIdle(); |
| 542 } | 542 } |
| 543 } | 543 } |
| 544 | 544 |
| 545 void AddBlankTabAndShow(Browser* browser) { | 545 void AddBlankTabAndShow(Browser* browser) { |
| (...skipping 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2496 DetachToBrowserTabDragControllerTest, | 2496 DetachToBrowserTabDragControllerTest, |
| 2497 ::testing::Values("mouse", "touch")); | 2497 ::testing::Values("mouse", "touch")); |
| 2498 INSTANTIATE_TEST_CASE_P(TabDragging, | 2498 INSTANTIATE_TEST_CASE_P(TabDragging, |
| 2499 DetachToBrowserTabDragControllerTestTouch, | 2499 DetachToBrowserTabDragControllerTestTouch, |
| 2500 ::testing::Values("touch")); | 2500 ::testing::Values("touch")); |
| 2501 #else | 2501 #else |
| 2502 INSTANTIATE_TEST_CASE_P(TabDragging, | 2502 INSTANTIATE_TEST_CASE_P(TabDragging, |
| 2503 DetachToBrowserTabDragControllerTest, | 2503 DetachToBrowserTabDragControllerTest, |
| 2504 ::testing::Values("mouse")); | 2504 ::testing::Values("mouse")); |
| 2505 #endif | 2505 #endif |
| OLD | NEW |