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