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 |
11 #include "ash/wm/window_state.h" | 11 #include "ash/wm/window_state.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "chrome/browser/chrome_notification_types.h" | 19 #include "chrome/browser/chrome_notification_types.h" |
20 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
21 #include "chrome/browser/ui/browser_commands.h" | 21 #include "chrome/browser/ui/browser_commands.h" |
22 #include "chrome/browser/ui/browser_iterator.h" | |
23 #include "chrome/browser/ui/browser_list.h" | 22 #include "chrome/browser/ui/browser_list.h" |
24 #include "chrome/browser/ui/browser_tabstrip.h" | 23 #include "chrome/browser/ui/browser_tabstrip.h" |
25 #include "chrome/browser/ui/host_desktop.h" | 24 #include "chrome/browser/ui/host_desktop.h" |
26 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 25 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
27 #include "chrome/browser/ui/views/frame/browser_view.h" | 26 #include "chrome/browser/ui/views/frame/browser_view.h" |
28 #include "chrome/browser/ui/views/frame/native_browser_frame_factory.h" | 27 #include "chrome/browser/ui/views/frame/native_browser_frame_factory.h" |
29 #include "chrome/browser/ui/views/tabs/tab.h" | 28 #include "chrome/browser/ui/views/tabs/tab.h" |
30 #include "chrome/browser/ui/views/tabs/tab_drag_controller.h" | 29 #include "chrome/browser/ui/views/tabs/tab_drag_controller.h" |
31 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 30 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
32 #include "chrome/test/base/in_process_browser_test.h" | 31 #include "chrome/test/base/in_process_browser_test.h" |
(...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1500 GetCenterInScreenCoordinates(tab_strip->tab_at(0))); | 1499 GetCenterInScreenCoordinates(tab_strip->tab_at(0))); |
1501 ASSERT_TRUE(PressInput(tab_0_center)); | 1500 ASSERT_TRUE(PressInput(tab_0_center)); |
1502 ASSERT_TRUE(DragInputToNotifyWhenDone( | 1501 ASSERT_TRUE(DragInputToNotifyWhenDone( |
1503 tab_0_center.x(), tab_0_center.y() + GetDetachY(tab_strip), | 1502 tab_0_center.x(), tab_0_center.y() + GetDetachY(tab_strip), |
1504 base::Bind(&CancelOnNewTabWhenDraggingStep2, this, browser_list))); | 1503 base::Bind(&CancelOnNewTabWhenDraggingStep2, this, browser_list))); |
1505 QuitWhenNotDragging(); | 1504 QuitWhenNotDragging(); |
1506 | 1505 |
1507 // Should be two windows and not dragging. | 1506 // Should be two windows and not dragging. |
1508 ASSERT_FALSE(TabDragController::IsActive()); | 1507 ASSERT_FALSE(TabDragController::IsActive()); |
1509 ASSERT_EQ(2u, browser_list->size()); | 1508 ASSERT_EQ(2u, browser_list->size()); |
1510 for (chrome::BrowserIterator it; !it.done(); it.Next()) { | 1509 for (auto* browser : *BrowserList::GetInstance()) { |
1511 EXPECT_FALSE(GetIsDragged(*it)); | 1510 EXPECT_FALSE(GetIsDragged(browser)); |
1512 // Should not be maximized | 1511 // Should not be maximized |
1513 EXPECT_FALSE(it->window()->IsMaximized()); | 1512 EXPECT_FALSE(browser->window()->IsMaximized()); |
1514 } | 1513 } |
1515 } | 1514 } |
1516 | 1515 |
1517 #if defined(OS_CHROMEOS) | 1516 #if defined(OS_CHROMEOS) |
1518 // TODO(sky,sad): A number of tests below are disabled as they fail due to | 1517 // TODO(sky,sad): A number of tests below are disabled as they fail due to |
1519 // resize locks with a real compositor. crbug.com/331924 | 1518 // resize locks with a real compositor. crbug.com/331924 |
1520 namespace { | 1519 namespace { |
1521 | 1520 |
1522 void DragInMaximizedWindowStep2(DetachToBrowserTabDragControllerTest* test, | 1521 void DragInMaximizedWindowStep2(DetachToBrowserTabDragControllerTest* test, |
1523 Browser* browser, | 1522 Browser* browser, |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2363 DetachToBrowserTabDragControllerTest, | 2362 DetachToBrowserTabDragControllerTest, |
2364 ::testing::Values("mouse", "touch")); | 2363 ::testing::Values("mouse", "touch")); |
2365 INSTANTIATE_TEST_CASE_P(TabDragging, | 2364 INSTANTIATE_TEST_CASE_P(TabDragging, |
2366 DetachToBrowserTabDragControllerTestTouch, | 2365 DetachToBrowserTabDragControllerTestTouch, |
2367 ::testing::Values("touch")); | 2366 ::testing::Values("touch")); |
2368 #elif defined(USE_ASH) | 2367 #elif defined(USE_ASH) |
2369 INSTANTIATE_TEST_CASE_P(TabDragging, | 2368 INSTANTIATE_TEST_CASE_P(TabDragging, |
2370 DetachToBrowserTabDragControllerTest, | 2369 DetachToBrowserTabDragControllerTest, |
2371 ::testing::Values("mouse")); | 2370 ::testing::Values("mouse")); |
2372 #endif | 2371 #endif |
OLD | NEW |