| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/aura/env.h" | 8 #include "ui/aura/env.h" |
| 9 #include "ui/aura/test/aura_test_base.h" | 9 #include "ui/aura/test/aura_test_base.h" |
| 10 #include "ui/aura/test/event_generator.h" | 10 #include "ui/aura/test/event_generator.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 namespace views { | 27 namespace views { |
| 28 | 28 |
| 29 class CaptureControllerTest : public aura::test::AuraTestBase { | 29 class CaptureControllerTest : public aura::test::AuraTestBase { |
| 30 public: | 30 public: |
| 31 CaptureControllerTest() {} | 31 CaptureControllerTest() {} |
| 32 | 32 |
| 33 virtual void SetUp() OVERRIDE { | 33 virtual void SetUp() OVERRIDE { |
| 34 AuraTestBase::SetUp(); | 34 AuraTestBase::SetUp(); |
| 35 capture_controller_.reset(new corewm::ScopedCaptureClient(root_window())); | 35 capture_controller_.reset(new wm::ScopedCaptureClient(root_window())); |
| 36 | 36 |
| 37 second_host_.reset(aura::WindowTreeHost::Create(gfx::Rect(0, 0, 800, 600))); | 37 second_host_.reset(aura::WindowTreeHost::Create(gfx::Rect(0, 0, 800, 600))); |
| 38 second_host_->InitHost(); | 38 second_host_->InitHost(); |
| 39 second_host_->window()->Show(); | 39 second_host_->window()->Show(); |
| 40 second_host_->SetBounds(gfx::Rect(800, 600)); | 40 second_host_->SetBounds(gfx::Rect(800, 600)); |
| 41 second_capture_controller_.reset( | 41 second_capture_controller_.reset( |
| 42 new corewm::ScopedCaptureClient(second_host_->window())); | 42 new wm::ScopedCaptureClient(second_host_->window())); |
| 43 | 43 |
| 44 #if !defined(OS_CHROMEOS) | 44 #if !defined(OS_CHROMEOS) |
| 45 desktop_position_client_.reset( | 45 desktop_position_client_.reset( |
| 46 new DesktopScreenPositionClient(root_window())); | 46 new DesktopScreenPositionClient(root_window())); |
| 47 | 47 |
| 48 second_desktop_position_client_.reset( | 48 second_desktop_position_client_.reset( |
| 49 new DesktopScreenPositionClient(second_host_->window())); | 49 new DesktopScreenPositionClient(second_host_->window())); |
| 50 #endif | 50 #endif |
| 51 } | 51 } |
| 52 | 52 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 70 } | 70 } |
| 71 | 71 |
| 72 aura::Window* GetCaptureWindow() { | 72 aura::Window* GetCaptureWindow() { |
| 73 return capture_controller_->capture_client()->GetCaptureWindow(); | 73 return capture_controller_->capture_client()->GetCaptureWindow(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 aura::Window* GetSecondCaptureWindow() { | 76 aura::Window* GetSecondCaptureWindow() { |
| 77 return second_capture_controller_->capture_client()->GetCaptureWindow(); | 77 return second_capture_controller_->capture_client()->GetCaptureWindow(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 scoped_ptr<corewm::ScopedCaptureClient> capture_controller_; | 80 scoped_ptr<wm::ScopedCaptureClient> capture_controller_; |
| 81 scoped_ptr<aura::WindowTreeHost> second_host_; | 81 scoped_ptr<aura::WindowTreeHost> second_host_; |
| 82 scoped_ptr<corewm::ScopedCaptureClient> second_capture_controller_; | 82 scoped_ptr<wm::ScopedCaptureClient> second_capture_controller_; |
| 83 #if !defined(OS_CHROMEOS) | 83 #if !defined(OS_CHROMEOS) |
| 84 scoped_ptr<aura::client::ScreenPositionClient> desktop_position_client_; | 84 scoped_ptr<aura::client::ScreenPositionClient> desktop_position_client_; |
| 85 scoped_ptr<aura::client::ScreenPositionClient> | 85 scoped_ptr<aura::client::ScreenPositionClient> |
| 86 second_desktop_position_client_; | 86 second_desktop_position_client_; |
| 87 #endif | 87 #endif |
| 88 | 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(CaptureControllerTest); | 89 DISALLOW_COPY_AND_ASSIGN(CaptureControllerTest); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 // Makes sure that internal details that are set on mouse down (such as | 92 // Makes sure that internal details that are set on mouse down (such as |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 EXPECT_EQ(static_cast<aura::Window*>(NULL), GetCaptureWindow()); | 159 EXPECT_EQ(static_cast<aura::Window*>(NULL), GetCaptureWindow()); |
| 160 EXPECT_EQ(static_cast<aura::Window*>(NULL), GetSecondCaptureWindow()); | 160 EXPECT_EQ(static_cast<aura::Window*>(NULL), GetSecondCaptureWindow()); |
| 161 ui::TouchEvent touch_event( | 161 ui::TouchEvent touch_event( |
| 162 ui::ET_TOUCH_PRESSED, gfx::Point(), 0, 0, ui::EventTimeForNow(), 1.0f, | 162 ui::ET_TOUCH_PRESSED, gfx::Point(), 0, 0, ui::EventTimeForNow(), 1.0f, |
| 163 1.0f, 1.0f, 1.0f); | 163 1.0f, 1.0f, 1.0f); |
| 164 EXPECT_EQ(static_cast<ui::GestureConsumer*>(w2.get()), | 164 EXPECT_EQ(static_cast<ui::GestureConsumer*>(w2.get()), |
| 165 ui::GestureRecognizer::Get()->GetTouchLockedTarget(touch_event)); | 165 ui::GestureRecognizer::Get()->GetTouchLockedTarget(touch_event)); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace views | 168 } // namespace views |
| OLD | NEW |