| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/path_service.h" | |
| 10 #include "ui/aura/env.h" | 9 #include "ui/aura/env.h" |
| 11 #include "ui/aura/test/test_window_delegate.h" | 10 #include "ui/aura/test/test_window_delegate.h" |
| 12 #include "ui/aura/window_event_dispatcher.h" | 11 #include "ui/aura/window_event_dispatcher.h" |
| 13 #include "ui/aura/window_tree_host.h" | 12 #include "ui/aura/window_tree_host.h" |
| 14 #include "ui/base/resource/resource_bundle.h" | |
| 15 #include "ui/base/ui_base_paths.h" | |
| 16 #include "ui/events/event.h" | 13 #include "ui/events/event.h" |
| 17 #include "ui/events/test/event_generator.h" | 14 #include "ui/events/test/event_generator.h" |
| 18 #include "ui/gl/test/gl_surface_test_support.h" | 15 #include "ui/views/test/views_interactive_ui_test_base.h" |
| 19 #include "ui/views/test/views_test_base.h" | |
| 20 #include "ui/views/view.h" | 16 #include "ui/views/view.h" |
| 21 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 17 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 22 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h" | 18 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h" |
| 23 #include "ui/views/widget/root_view.h" | 19 #include "ui/views/widget/root_view.h" |
| 24 #include "ui/views/widget/widget.h" | 20 #include "ui/views/widget/widget.h" |
| 25 | 21 |
| 26 // NOTE: these tests do native capture, so they have to be in | 22 // NOTE: these tests do native capture, so they have to be in |
| 27 // interactive_ui_tests. | 23 // interactive_ui_tests. |
| 28 | 24 |
| 29 namespace views { | 25 namespace views { |
| 30 | 26 |
| 31 class DesktopCaptureControllerTest : public ViewsTestBase { | 27 using DesktopCaptureControllerTest = ViewsInteractiveUITestBase; |
| 32 public: | |
| 33 DesktopCaptureControllerTest() {} | |
| 34 ~DesktopCaptureControllerTest() override {} | |
| 35 | |
| 36 void SetUp() override { | |
| 37 gl::GLSurfaceTestSupport::InitializeOneOff(); | |
| 38 ui::RegisterPathProvider(); | |
| 39 base::FilePath ui_test_pak_path; | |
| 40 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | |
| 41 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | |
| 42 | |
| 43 ViewsTestBase::SetUp(); | |
| 44 } | |
| 45 }; | |
| 46 | 28 |
| 47 // This class provides functionality to verify whether the View instance | 29 // This class provides functionality to verify whether the View instance |
| 48 // received the gesture event. | 30 // received the gesture event. |
| 49 class DesktopViewInputTest : public View { | 31 class DesktopViewInputTest : public View { |
| 50 public: | 32 public: |
| 51 DesktopViewInputTest() | 33 DesktopViewInputTest() |
| 52 : received_gesture_event_(false) {} | 34 : received_gesture_event_(false) {} |
| 53 | 35 |
| 54 void OnGestureEvent(ui::GestureEvent* event) override { | 36 void OnGestureEvent(ui::GestureEvent* event) override { |
| 55 received_gesture_event_ = true; | 37 received_gesture_event_ = true; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 173 |
| 192 EXPECT_TRUE(v2->received_gesture_event()); | 174 EXPECT_TRUE(v2->received_gesture_event()); |
| 193 EXPECT_FALSE(v1->received_gesture_event()); | 175 EXPECT_FALSE(v1->received_gesture_event()); |
| 194 | 176 |
| 195 widget1->CloseNow(); | 177 widget1->CloseNow(); |
| 196 widget2->CloseNow(); | 178 widget2->CloseNow(); |
| 197 RunPendingMessages(); | 179 RunPendingMessages(); |
| 198 } | 180 } |
| 199 | 181 |
| 200 } // namespace views | 182 } // namespace views |
| OLD | NEW |