| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/wm/core/capture_controller.h" | 5 #include "ui/wm/core/capture_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 public: | 54 public: |
| 55 CaptureControllerTest() {} | 55 CaptureControllerTest() {} |
| 56 | 56 |
| 57 void SetUp() override { | 57 void SetUp() override { |
| 58 AuraTestBase::SetUp(); | 58 AuraTestBase::SetUp(); |
| 59 capture_controller_.reset(new ScopedCaptureClient(root_window())); | 59 capture_controller_.reset(new ScopedCaptureClient(root_window())); |
| 60 | 60 |
| 61 second_host_.reset(aura::WindowTreeHost::Create(gfx::Rect(0, 0, 800, 600))); | 61 second_host_.reset(aura::WindowTreeHost::Create(gfx::Rect(0, 0, 800, 600))); |
| 62 second_host_->InitHost(); | 62 second_host_->InitHost(); |
| 63 second_host_->window()->Show(); | 63 second_host_->window()->Show(); |
| 64 second_host_->SetBounds(gfx::Rect(800, 600)); | 64 second_host_->SetBoundsInPixels(gfx::Rect(800, 600)); |
| 65 second_capture_controller_.reset( | 65 second_capture_controller_.reset( |
| 66 new ScopedCaptureClient(second_host_->window())); | 66 new ScopedCaptureClient(second_host_->window())); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void TearDown() override { | 69 void TearDown() override { |
| 70 RunAllPendingInMessageLoop(); | 70 RunAllPendingInMessageLoop(); |
| 71 | 71 |
| 72 second_capture_controller_.reset(); | 72 second_capture_controller_.reset(); |
| 73 | 73 |
| 74 // Kill any active compositors before we hit the compositor shutdown paths. | 74 // Kill any active compositors before we hit the compositor shutdown paths. |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 ASSERT_NE(nullptr, capture_client); | 256 ASSERT_NE(nullptr, capture_client); |
| 257 EXPECT_EQ(nullptr, capture_client->GetCaptureWindow()); | 257 EXPECT_EQ(nullptr, capture_client->GetCaptureWindow()); |
| 258 | 258 |
| 259 // Send a mouse click. We no longer hold capture so this should not crash. | 259 // Send a mouse click. We no longer hold capture so this should not crash. |
| 260 ui::MouseEvent mouse_press(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), | 260 ui::MouseEvent mouse_press(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), |
| 261 base::TimeTicks(), 0, 0); | 261 base::TimeTicks(), 0, 0); |
| 262 DispatchEventUsingWindowDispatcher(&mouse_press); | 262 DispatchEventUsingWindowDispatcher(&mouse_press); |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace wm | 265 } // namespace wm |
| OLD | NEW |