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 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 if (!SupportsMultipleDisplays()) | 1870 if (!SupportsMultipleDisplays()) |
1871 return; | 1871 return; |
1872 | 1872 |
1873 UpdateDisplay("500x400,500x400"); | 1873 UpdateDisplay("500x400,500x400"); |
1874 window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), | 1874 window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), |
1875 Shell::GetScreen()->GetPrimaryDisplay()); | 1875 Shell::GetScreen()->GetPrimaryDisplay()); |
1876 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 1876 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
1877 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); | 1877 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); |
1878 | 1878 |
1879 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( | 1879 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
1880 window_.get(), gfx::Point(), HTCAPTION, | 1880 window_.get(), gfx::Point(0,0), HTCAPTION, |
1881 aura::client::WINDOW_MOVE_SOURCE_MOUSE, empty_windows())); | 1881 aura::client::WINDOW_MOVE_SOURCE_MOUSE, empty_windows())); |
1882 ASSERT_TRUE(resizer.get()); | 1882 ASSERT_TRUE(resizer.get()); |
1883 EXPECT_FALSE(resizer->snap_phantom_window_controller_.get()); | 1883 EXPECT_FALSE(resizer->snap_phantom_window_controller_.get()); |
1884 | 1884 |
1885 // The pointer is on the edge but not shared. The snap phantom window | 1885 // The pointer is on the edge but not shared. The snap phantom window |
1886 // controller should be non-NULL. | 1886 // controller should be non-NULL. |
1887 resizer->Drag(CalculateDragPoint(*resizer, 499, 0), 0); | 1887 resizer->Drag(CalculateDragPoint(*resizer, -1, 0), 0); |
1888 EXPECT_TRUE(resizer->snap_phantom_window_controller_.get()); | 1888 EXPECT_TRUE(resizer->snap_phantom_window_controller_.get()); |
1889 PhantomWindowController* phantom_controller( | 1889 PhantomWindowController* phantom_controller( |
1890 resizer->snap_phantom_window_controller_.get()); | 1890 resizer->snap_phantom_window_controller_.get()); |
1891 | 1891 |
1892 // phantom widget only in the left screen. | 1892 // phantom widget only in the left screen. |
1893 phantom_controller->Show(gfx::Rect(100, 100, 50, 60)); | 1893 phantom_controller->Show(gfx::Rect(100, 100, 50, 60)); |
1894 EXPECT_TRUE(phantom_controller->phantom_widget_); | 1894 EXPECT_TRUE(phantom_controller->phantom_widget_); |
1895 EXPECT_FALSE(phantom_controller->phantom_widget_start_); | 1895 EXPECT_FALSE(phantom_controller->phantom_widget_start_); |
1896 EXPECT_EQ( | 1896 EXPECT_EQ( |
1897 root_windows[0], | 1897 root_windows[0], |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1969 RunAnimationTillComplete(phantom_controller->animation_.get()); | 1969 RunAnimationTillComplete(phantom_controller->animation_.get()); |
1970 | 1970 |
1971 // Hide phantom controller. Both widgets should close. | 1971 // Hide phantom controller. Both widgets should close. |
1972 phantom_controller->Hide(); | 1972 phantom_controller->Hide(); |
1973 EXPECT_FALSE(phantom_controller->phantom_widget_); | 1973 EXPECT_FALSE(phantom_controller->phantom_widget_); |
1974 EXPECT_FALSE(phantom_controller->phantom_widget_start_); | 1974 EXPECT_FALSE(phantom_controller->phantom_widget_start_); |
1975 } | 1975 } |
1976 | 1976 |
1977 } // namespace internal | 1977 } // namespace internal |
1978 } // namespace ash | 1978 } // namespace ash |
OLD | NEW |