| 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_event_handler.h" | 5 #include "ash/wm/workspace/workspace_event_handler.h" |
| 6 | 6 |
| 7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 10 #include "ash/wm/window_state.h" | 10 #include "ash/wm/window_state.h" |
| 11 #include "ash/wm/window_util.h" | 11 #include "ash/wm/window_util.h" |
| 12 #include "ash/wm/workspace_controller.h" | 12 #include "ash/wm/workspace_controller.h" |
| 13 #include "ash/wm/workspace_controller_test_helper.h" | 13 #include "ash/wm/workspace_controller_test_helper.h" |
| 14 #include "ui/aura/client/aura_constants.h" | 14 #include "ui/aura/client/aura_constants.h" |
| 15 #include "ui/aura/client/window_move_client.h" |
| 15 #include "ui/aura/root_window.h" | 16 #include "ui/aura/root_window.h" |
| 16 #include "ui/aura/test/event_generator.h" | 17 #include "ui/aura/test/event_generator.h" |
| 17 #include "ui/aura/test/test_window_delegate.h" | 18 #include "ui/aura/test/test_window_delegate.h" |
| 18 #include "ui/aura/window.h" | 19 #include "ui/aura/window.h" |
| 19 #include "ui/base/hit_test.h" | 20 #include "ui/base/hit_test.h" |
| 20 #include "ui/gfx/screen.h" | 21 #include "ui/gfx/screen.h" |
| 21 | 22 |
| 22 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
| 23 #include "base/win/windows_version.h" | 24 #include "base/win/windows_version.h" |
| 24 #endif | 25 #endif |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 generator.MoveMouseTo(generator.current_location() + gfx::Vector2d(50, 50)); | 330 generator.MoveMouseTo(generator.current_location() + gfx::Vector2d(50, 50)); |
| 330 } | 331 } |
| 331 | 332 |
| 332 // Verifies deleting the window while in a run loop doesn't crash. | 333 // Verifies deleting the window while in a run loop doesn't crash. |
| 333 TEST_F(WorkspaceEventHandlerTest, DeleteWhileInRunLoop) { | 334 TEST_F(WorkspaceEventHandlerTest, DeleteWhileInRunLoop) { |
| 334 aura::test::TestWindowDelegate wd; | 335 aura::test::TestWindowDelegate wd; |
| 335 const gfx::Rect bounds(10, 20, 30, 40); | 336 const gfx::Rect bounds(10, 20, 30, 40); |
| 336 scoped_ptr<aura::Window> window(CreateTestWindow(&wd, bounds)); | 337 scoped_ptr<aura::Window> window(CreateTestWindow(&wd, bounds)); |
| 337 wd.set_window_component(HTCAPTION); | 338 wd.set_window_component(HTCAPTION); |
| 338 | 339 |
| 339 ASSERT_TRUE(aura::client::GetWindowMoveClient(window->parent())); | 340 ASSERT_TRUE(aura::client::GetWindowMoveClient(window->GetRootWindow())); |
| 340 base::MessageLoop::current()->DeleteSoon(FROM_HERE, window.get()); | 341 base::MessageLoop::current()->DeleteSoon(FROM_HERE, window.get()); |
| 341 aura::client::GetWindowMoveClient(window->parent()) | 342 aura::client::GetWindowMoveClient(window->GetRootWindow()) |
| 342 ->RunMoveLoop(window.release(), | 343 ->RunMoveLoop(window.release(), |
| 343 gfx::Vector2d(), | 344 gfx::Vector2d(), |
| 344 aura::client::WINDOW_MOVE_SOURCE_MOUSE); | 345 aura::client::WINDOW_MOVE_SOURCE_MOUSE); |
| 345 } | 346 } |
| 346 | 347 |
| 347 } // namespace internal | 348 } // namespace internal |
| 348 } // namespace ash | 349 } // namespace ash |
| OLD | NEW |