| 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 "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "ui/aura/env.h" | 9 #include "ui/aura/env.h" |
| 10 #include "ui/aura/test/test_window_delegate.h" | 10 #include "ui/aura/test/test_window_delegate.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // NOTE: these tests do native capture, so they have to be in | 25 // NOTE: these tests do native capture, so they have to be in |
| 26 // interactive_ui_tests. | 26 // interactive_ui_tests. |
| 27 | 27 |
| 28 namespace views { | 28 namespace views { |
| 29 | 29 |
| 30 class DesktopCaptureControllerTest : public ViewsTestBase { | 30 class DesktopCaptureControllerTest : public ViewsTestBase { |
| 31 public: | 31 public: |
| 32 DesktopCaptureControllerTest() {} | 32 DesktopCaptureControllerTest() {} |
| 33 virtual ~DesktopCaptureControllerTest() {} | 33 virtual ~DesktopCaptureControllerTest() {} |
| 34 | 34 |
| 35 virtual void SetUp() OVERRIDE { | 35 virtual void SetUp() override { |
| 36 gfx::GLSurface::InitializeOneOffForTests(); | 36 gfx::GLSurface::InitializeOneOffForTests(); |
| 37 ui::RegisterPathProvider(); | 37 ui::RegisterPathProvider(); |
| 38 base::FilePath ui_test_pak_path; | 38 base::FilePath ui_test_pak_path; |
| 39 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 39 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); |
| 40 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 40 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); |
| 41 | 41 |
| 42 ViewsTestBase::SetUp(); | 42 ViewsTestBase::SetUp(); |
| 43 } | 43 } |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 // This class provides functionality to verify whether the View instance | 46 // This class provides functionality to verify whether the View instance |
| 47 // received the gesture event. | 47 // received the gesture event. |
| 48 class DesktopViewInputTest : public View { | 48 class DesktopViewInputTest : public View { |
| 49 public: | 49 public: |
| 50 DesktopViewInputTest() | 50 DesktopViewInputTest() |
| 51 : received_gesture_event_(false) {} | 51 : received_gesture_event_(false) {} |
| 52 | 52 |
| 53 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE { | 53 virtual void OnGestureEvent(ui::GestureEvent* event) override { |
| 54 received_gesture_event_ = true; | 54 received_gesture_event_ = true; |
| 55 return View::OnGestureEvent(event); | 55 return View::OnGestureEvent(event); |
| 56 } | 56 } |
| 57 | 57 |
| 58 // Resets state maintained by this class. | 58 // Resets state maintained by this class. |
| 59 void Reset() { | 59 void Reset() { |
| 60 received_gesture_event_ = false; | 60 received_gesture_event_ = false; |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool received_gesture_event() const { return received_gesture_event_; } | 63 bool received_gesture_event() const { return received_gesture_event_; } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 EXPECT_TRUE(v2->received_gesture_event()); | 194 EXPECT_TRUE(v2->received_gesture_event()); |
| 195 EXPECT_FALSE(v1->received_gesture_event()); | 195 EXPECT_FALSE(v1->received_gesture_event()); |
| 196 | 196 |
| 197 widget1->CloseNow(); | 197 widget1->CloseNow(); |
| 198 widget2->CloseNow(); | 198 widget2->CloseNow(); |
| 199 RunPendingMessages(); | 199 RunPendingMessages(); |
| 200 } | 200 } |
| 201 | 201 |
| 202 } // namespace views | 202 } // namespace views |
| OLD | NEW |