| 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/multi_window_resize_controller.h" | 5 #include "ash/wm/workspace/multi_window_resize_controller.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
| 10 #include "ash/wm/workspace_controller.h" | 10 #include "ash/wm/workspace_controller.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 EXPECT_FALSE(HasPendingHide()); | 143 EXPECT_FALSE(HasPendingHide()); |
| 144 | 144 |
| 145 // Force a show now. | 145 // Force a show now. |
| 146 ShowNow(); | 146 ShowNow(); |
| 147 EXPECT_FALSE(HasPendingShow()); | 147 EXPECT_FALSE(HasPendingShow()); |
| 148 EXPECT_TRUE(IsShowing()); | 148 EXPECT_TRUE(IsShowing()); |
| 149 EXPECT_FALSE(HasPendingHide()); | 149 EXPECT_FALSE(HasPendingHide()); |
| 150 | 150 |
| 151 // Move the mouse over the resize widget. | 151 // Move the mouse over the resize widget. |
| 152 ASSERT_TRUE(resize_widget()); | 152 ASSERT_TRUE(resize_widget()); |
| 153 gfx::Rect bounds(resize_widget()->GetWindowScreenBounds()); | 153 gfx::Rect bounds(resize_widget()->GetWindowBoundsInScreen()); |
| 154 generator.MoveMouseTo(bounds.x() + 1, bounds.y() + 1); | 154 generator.MoveMouseTo(bounds.x() + 1, bounds.y() + 1); |
| 155 EXPECT_FALSE(HasPendingShow()); | 155 EXPECT_FALSE(HasPendingShow()); |
| 156 EXPECT_TRUE(IsShowing()); | 156 EXPECT_TRUE(IsShowing()); |
| 157 EXPECT_FALSE(HasPendingHide()); | 157 EXPECT_FALSE(HasPendingHide()); |
| 158 | 158 |
| 159 // Move the resize widget | 159 // Move the resize widget |
| 160 generator.PressLeftButton(); | 160 generator.PressLeftButton(); |
| 161 generator.MoveMouseTo(bounds.x() + 10, bounds.y() + 10); | 161 generator.MoveMouseTo(bounds.x() + 10, bounds.y() + 10); |
| 162 | 162 |
| 163 // Delete w2. | 163 // Delete w2. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 186 EXPECT_FALSE(HasPendingHide()); | 186 EXPECT_FALSE(HasPendingHide()); |
| 187 | 187 |
| 188 // Force a show now. | 188 // Force a show now. |
| 189 ShowNow(); | 189 ShowNow(); |
| 190 EXPECT_FALSE(HasPendingShow()); | 190 EXPECT_FALSE(HasPendingShow()); |
| 191 EXPECT_TRUE(IsShowing()); | 191 EXPECT_TRUE(IsShowing()); |
| 192 EXPECT_FALSE(HasPendingHide()); | 192 EXPECT_FALSE(HasPendingHide()); |
| 193 | 193 |
| 194 // Move the mouse over the resize widget. | 194 // Move the mouse over the resize widget. |
| 195 ASSERT_TRUE(resize_widget()); | 195 ASSERT_TRUE(resize_widget()); |
| 196 gfx::Rect bounds(resize_widget()->GetWindowScreenBounds()); | 196 gfx::Rect bounds(resize_widget()->GetWindowBoundsInScreen()); |
| 197 generator.MoveMouseTo(bounds.x() + 1, bounds.y() + 1); | 197 generator.MoveMouseTo(bounds.x() + 1, bounds.y() + 1); |
| 198 EXPECT_FALSE(HasPendingShow()); | 198 EXPECT_FALSE(HasPendingShow()); |
| 199 EXPECT_TRUE(IsShowing()); | 199 EXPECT_TRUE(IsShowing()); |
| 200 EXPECT_FALSE(HasPendingHide()); | 200 EXPECT_FALSE(HasPendingHide()); |
| 201 | 201 |
| 202 // Move the resize widget | 202 // Move the resize widget |
| 203 generator.PressLeftButton(); | 203 generator.PressLeftButton(); |
| 204 generator.MoveMouseTo(bounds.x() + 11, bounds.y() + 10); | 204 generator.MoveMouseTo(bounds.x() + 11, bounds.y() + 10); |
| 205 generator.ReleaseLeftButton(); | 205 generator.ReleaseLeftButton(); |
| 206 | 206 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 233 EXPECT_TRUE(IsShowing()); | 233 EXPECT_TRUE(IsShowing()); |
| 234 EXPECT_FALSE(HasPendingHide()); | 234 EXPECT_FALSE(HasPendingHide()); |
| 235 EXPECT_FALSE(HasTarget(w3.get())); | 235 EXPECT_FALSE(HasTarget(w3.get())); |
| 236 | 236 |
| 237 ShowNow(); | 237 ShowNow(); |
| 238 EXPECT_FALSE(HasPendingShow()); | 238 EXPECT_FALSE(HasPendingShow()); |
| 239 EXPECT_TRUE(IsShowing()); | 239 EXPECT_TRUE(IsShowing()); |
| 240 EXPECT_FALSE(HasPendingHide()); | 240 EXPECT_FALSE(HasPendingHide()); |
| 241 | 241 |
| 242 // w3 should be picked up when resize is started. | 242 // w3 should be picked up when resize is started. |
| 243 gfx::Rect bounds(resize_widget()->GetWindowScreenBounds()); | 243 gfx::Rect bounds(resize_widget()->GetWindowBoundsInScreen()); |
| 244 generator.MoveMouseTo(bounds.x() + 1, bounds.y() + 1); | 244 generator.MoveMouseTo(bounds.x() + 1, bounds.y() + 1); |
| 245 generator.PressLeftButton(); | 245 generator.PressLeftButton(); |
| 246 generator.MoveMouseTo(bounds.x() + 11, bounds.y() + 10); | 246 generator.MoveMouseTo(bounds.x() + 11, bounds.y() + 10); |
| 247 | 247 |
| 248 EXPECT_TRUE(HasTarget(w3.get())); | 248 EXPECT_TRUE(HasTarget(w3.get())); |
| 249 } | 249 } |
| 250 | 250 |
| 251 } // namespace internal | 251 } // namespace internal |
| 252 } // namespace ash | 252 } // namespace ash |
| OLD | NEW |