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 "ash/wm/workspace/workspace_window_resizer.h" | 5 #include "ash/wm/workspace/workspace_window_resizer.h" |
6 | 6 |
7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
9 #include "ash/display/display_controller.h" | 9 #include "ash/display/display_controller.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1836 if (!SupportsMultipleDisplays()) | 1836 if (!SupportsMultipleDisplays()) |
1837 return; | 1837 return; |
1838 | 1838 |
1839 UpdateDisplay("500x400,500x400"); | 1839 UpdateDisplay("500x400,500x400"); |
1840 window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), | 1840 window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), |
1841 Shell::GetScreen()->GetPrimaryDisplay()); | 1841 Shell::GetScreen()->GetPrimaryDisplay()); |
1842 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 1842 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
1843 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); | 1843 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); |
1844 | 1844 |
1845 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( | 1845 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
1846 window_.get(), gfx::Point(), HTCAPTION, | 1846 window_.get(), gfx::Point(0,0), HTCAPTION, |
1847 aura::client::WINDOW_MOVE_SOURCE_MOUSE, empty_windows())); | 1847 aura::client::WINDOW_MOVE_SOURCE_MOUSE, empty_windows())); |
1848 ASSERT_TRUE(resizer.get()); | 1848 ASSERT_TRUE(resizer.get()); |
1849 EXPECT_FALSE(resizer->snap_phantom_window_controller_.get()); | 1849 EXPECT_FALSE(resizer->snap_phantom_window_controller_.get()); |
1850 | 1850 |
1851 // The pointer is on the edge but not shared. The snap phantom window | 1851 // The pointer is on the edge but not shared. The snap phantom window |
1852 // controller should be non-NULL. | 1852 // controller should be non-NULL. |
1853 resizer->Drag(CalculateDragPoint(*resizer, 499, 0), 0); | 1853 resizer->Drag(CalculateDragPoint(*resizer, -1, 0), 0); |
1854 EXPECT_TRUE(resizer->snap_phantom_window_controller_.get()); | 1854 EXPECT_TRUE(resizer->snap_phantom_window_controller_.get()); |
1855 PhantomWindowController* phantom_controller( | 1855 PhantomWindowController* phantom_controller( |
1856 resizer->snap_phantom_window_controller_.get()); | 1856 resizer->snap_phantom_window_controller_.get()); |
1857 | 1857 |
1858 // phantom widget only in the left screen. | 1858 // phantom widget only in the left screen. |
1859 phantom_controller->Show(gfx::Rect(100, 100, 50, 60)); | 1859 phantom_controller->Show(gfx::Rect(100, 100, 50, 60)); |
1860 EXPECT_TRUE(phantom_controller->phantom_widget_); | 1860 EXPECT_TRUE(phantom_controller->phantom_widget_); |
1861 EXPECT_FALSE(phantom_controller->phantom_widget_start_); | 1861 EXPECT_FALSE(phantom_controller->phantom_widget_start_); |
1862 EXPECT_EQ( | 1862 EXPECT_EQ( |
1863 root_windows[0], | 1863 root_windows[0], |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1935 RunAnimationTillComplete(phantom_controller->animation_.get()); | 1935 RunAnimationTillComplete(phantom_controller->animation_.get()); |
1936 | 1936 |
1937 // Hide phantom controller. Both widgets should close. | 1937 // Hide phantom controller. Both widgets should close. |
1938 phantom_controller->Hide(); | 1938 phantom_controller->Hide(); |
1939 EXPECT_FALSE(phantom_controller->phantom_widget_); | 1939 EXPECT_FALSE(phantom_controller->phantom_widget_); |
1940 EXPECT_FALSE(phantom_controller->phantom_widget_start_); | 1940 EXPECT_FALSE(phantom_controller->phantom_widget_start_); |
1941 } | 1941 } |
1942 | 1942 |
1943 } // namespace internal | 1943 } // namespace internal |
1944 } // namespace ash | 1944 } // namespace ash |
OLD | NEW |