| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1433 } | 1433 } |
| 1434 | 1434 |
| 1435 // Subclass of DetachToBrowserTabDragControllerTest that | 1435 // Subclass of DetachToBrowserTabDragControllerTest that |
| 1436 // creates multiple displays. | 1436 // creates multiple displays. |
| 1437 class DetachToBrowserInSeparateDisplayTabDragControllerTest | 1437 class DetachToBrowserInSeparateDisplayTabDragControllerTest |
| 1438 : public DetachToBrowserTabDragControllerTest { | 1438 : public DetachToBrowserTabDragControllerTest { |
| 1439 public: | 1439 public: |
| 1440 DetachToBrowserInSeparateDisplayTabDragControllerTest() {} | 1440 DetachToBrowserInSeparateDisplayTabDragControllerTest() {} |
| 1441 virtual ~DetachToBrowserInSeparateDisplayTabDragControllerTest() {} | 1441 virtual ~DetachToBrowserInSeparateDisplayTabDragControllerTest() {} |
| 1442 | 1442 |
| 1443 virtual void SetUpCommandLine(CommandLine* command_line) override { | 1443 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
| 1444 DetachToBrowserTabDragControllerTest::SetUpCommandLine(command_line); | 1444 DetachToBrowserTabDragControllerTest::SetUpCommandLine(command_line); |
| 1445 // Make screens sufficiently wide to host 2 browsers side by side. | 1445 // Make screens sufficiently wide to host 2 browsers side by side. |
| 1446 command_line->AppendSwitchASCII("ash-host-window-bounds", | 1446 command_line->AppendSwitchASCII("ash-host-window-bounds", |
| 1447 "0+0-600x600,601+0-600x600"); | 1447 "0+0-600x600,601+0-600x600"); |
| 1448 } | 1448 } |
| 1449 | 1449 |
| 1450 private: | 1450 private: |
| 1451 DISALLOW_COPY_AND_ASSIGN( | 1451 DISALLOW_COPY_AND_ASSIGN( |
| 1452 DetachToBrowserInSeparateDisplayTabDragControllerTest); | 1452 DetachToBrowserInSeparateDisplayTabDragControllerTest); |
| 1453 }; | 1453 }; |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1811 } | 1811 } |
| 1812 | 1812 |
| 1813 // Subclass of DetachToBrowserTabDragControllerTest that | 1813 // Subclass of DetachToBrowserTabDragControllerTest that |
| 1814 // creates multiple displays with different device scale factors. | 1814 // creates multiple displays with different device scale factors. |
| 1815 class DifferentDeviceScaleFactorDisplayTabDragControllerTest | 1815 class DifferentDeviceScaleFactorDisplayTabDragControllerTest |
| 1816 : public DetachToBrowserTabDragControllerTest { | 1816 : public DetachToBrowserTabDragControllerTest { |
| 1817 public: | 1817 public: |
| 1818 DifferentDeviceScaleFactorDisplayTabDragControllerTest() {} | 1818 DifferentDeviceScaleFactorDisplayTabDragControllerTest() {} |
| 1819 virtual ~DifferentDeviceScaleFactorDisplayTabDragControllerTest() {} | 1819 virtual ~DifferentDeviceScaleFactorDisplayTabDragControllerTest() {} |
| 1820 | 1820 |
| 1821 virtual void SetUpCommandLine(CommandLine* command_line) override { | 1821 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
| 1822 DetachToBrowserTabDragControllerTest::SetUpCommandLine(command_line); | 1822 DetachToBrowserTabDragControllerTest::SetUpCommandLine(command_line); |
| 1823 command_line->AppendSwitchASCII("ash-host-window-bounds", | 1823 command_line->AppendSwitchASCII("ash-host-window-bounds", |
| 1824 "400x400,0+400-800x800*2"); | 1824 "400x400,0+400-800x800*2"); |
| 1825 } | 1825 } |
| 1826 | 1826 |
| 1827 float GetCursorDeviceScaleFactor() const { | 1827 float GetCursorDeviceScaleFactor() const { |
| 1828 ash::test::CursorManagerTestApi cursor_test_api( | 1828 ash::test::CursorManagerTestApi cursor_test_api( |
| 1829 ash::Shell::GetInstance()->cursor_manager()); | 1829 ash::Shell::GetInstance()->cursor_manager()); |
| 1830 return cursor_test_api.GetCurrentCursor().device_scale_factor(); | 1830 return cursor_test_api.GetCurrentCursor().device_scale_factor(); |
| 1831 } | 1831 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1910 QuitWhenNotDragging(); | 1910 QuitWhenNotDragging(); |
| 1911 } | 1911 } |
| 1912 | 1912 |
| 1913 namespace { | 1913 namespace { |
| 1914 | 1914 |
| 1915 class DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest | 1915 class DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest |
| 1916 : public TabDragControllerTest { | 1916 : public TabDragControllerTest { |
| 1917 public: | 1917 public: |
| 1918 DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest() {} | 1918 DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest() {} |
| 1919 | 1919 |
| 1920 virtual void SetUpCommandLine(CommandLine* command_line) override { | 1920 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
| 1921 TabDragControllerTest::SetUpCommandLine(command_line); | 1921 TabDragControllerTest::SetUpCommandLine(command_line); |
| 1922 command_line->AppendSwitchASCII("ash-host-window-bounds", | 1922 command_line->AppendSwitchASCII("ash-host-window-bounds", |
| 1923 "0+0-250x250,251+0-250x250"); | 1923 "0+0-250x250,251+0-250x250"); |
| 1924 } | 1924 } |
| 1925 | 1925 |
| 1926 bool Press(const gfx::Point& position) { | 1926 bool Press(const gfx::Point& position) { |
| 1927 return ui_test_utils::SendMouseMoveSync(position) && | 1927 return ui_test_utils::SendMouseMoveSync(position) && |
| 1928 ui_test_utils::SendMouseEventsSync(ui_controls::LEFT, | 1928 ui_test_utils::SendMouseEventsSync(ui_controls::LEFT, |
| 1929 ui_controls::DOWN); | 1929 ui_controls::DOWN); |
| 1930 } | 1930 } |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2208 DetachToBrowserTabDragControllerTest, | 2208 DetachToBrowserTabDragControllerTest, |
| 2209 ::testing::Values("mouse", "touch")); | 2209 ::testing::Values("mouse", "touch")); |
| 2210 INSTANTIATE_TEST_CASE_P(TabDragging, | 2210 INSTANTIATE_TEST_CASE_P(TabDragging, |
| 2211 DetachToBrowserTabDragControllerTestTouch, | 2211 DetachToBrowserTabDragControllerTestTouch, |
| 2212 ::testing::Values("touch")); | 2212 ::testing::Values("touch")); |
| 2213 #elif defined(USE_ASH) | 2213 #elif defined(USE_ASH) |
| 2214 INSTANTIATE_TEST_CASE_P(TabDragging, | 2214 INSTANTIATE_TEST_CASE_P(TabDragging, |
| 2215 DetachToBrowserTabDragControllerTest, | 2215 DetachToBrowserTabDragControllerTest, |
| 2216 ::testing::Values("mouse")); | 2216 ::testing::Values("mouse")); |
| 2217 #endif | 2217 #endif |
| OLD | NEW |