OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/test/layouttest_support.h" | 5 #include "content/public/test/layouttest_support.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "content/renderer/gpu/render_widget_compositor.h" | 31 #include "content/renderer/gpu/render_widget_compositor.h" |
32 #include "content/renderer/history_entry.h" | 32 #include "content/renderer/history_entry.h" |
33 #include "content/renderer/history_serialization.h" | 33 #include "content/renderer/history_serialization.h" |
34 #include "content/renderer/layout_test_dependencies.h" | 34 #include "content/renderer/layout_test_dependencies.h" |
35 #include "content/renderer/render_frame_impl.h" | 35 #include "content/renderer/render_frame_impl.h" |
36 #include "content/renderer/render_thread_impl.h" | 36 #include "content/renderer/render_thread_impl.h" |
37 #include "content/renderer/render_view_impl.h" | 37 #include "content/renderer/render_view_impl.h" |
38 #include "content/renderer/render_widget.h" | 38 #include "content/renderer/render_widget.h" |
39 #include "content/renderer/renderer_blink_platform_impl.h" | 39 #include "content/renderer/renderer_blink_platform_impl.h" |
40 #include "content/shell/common/shell_switches.h" | 40 #include "content/shell/common/shell_switches.h" |
| 41 #include "device/sensors/public/cpp/motion_data.h" |
| 42 #include "device/sensors/public/cpp/orientation_data.h" |
41 #include "gpu/ipc/service/image_transport_surface.h" | 43 #include "gpu/ipc/service/image_transport_surface.h" |
42 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 44 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
43 #include "third_party/WebKit/public/platform/WebGamepads.h" | 45 #include "third_party/WebKit/public/platform/WebGamepads.h" |
44 #include "third_party/WebKit/public/platform/WebInputEvent.h" | 46 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
45 #include "third_party/WebKit/public/platform/WebRect.h" | 47 #include "third_party/WebKit/public/platform/WebRect.h" |
46 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionData.h" | |
47 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationData.h" | |
48 #include "third_party/WebKit/public/platform/scheduler/test/renderer_scheduler_t
est_support.h" | 48 #include "third_party/WebKit/public/platform/scheduler/test/renderer_scheduler_t
est_support.h" |
49 #include "third_party/WebKit/public/web/WebHistoryItem.h" | 49 #include "third_party/WebKit/public/web/WebHistoryItem.h" |
50 #include "third_party/WebKit/public/web/WebView.h" | 50 #include "third_party/WebKit/public/web/WebView.h" |
51 #include "ui/events/blink/blink_event_util.h" | 51 #include "ui/events/blink/blink_event_util.h" |
52 #include "ui/gfx/geometry/vector2d.h" | 52 #include "ui/gfx/geometry/vector2d.h" |
53 #include "ui/gfx/icc_profile.h" | 53 #include "ui/gfx/icc_profile.h" |
54 | 54 |
55 #if defined(OS_MACOSX) | 55 #if defined(OS_MACOSX) |
56 #include "content/browser/frame_host/popup_menu_helper_mac.h" | 56 #include "content/browser/frame_host/popup_menu_helper_mac.h" |
57 #elif defined(OS_WIN) | 57 #elif defined(OS_WIN) |
58 #include "content/child/font_warmup_win.h" | 58 #include "content/child/font_warmup_win.h" |
59 #include "third_party/WebKit/public/web/win/WebFontRendering.h" | 59 #include "third_party/WebKit/public/web/win/WebFontRendering.h" |
60 #include "third_party/skia/include/ports/SkFontMgr.h" | 60 #include "third_party/skia/include/ports/SkFontMgr.h" |
61 #include "third_party/skia/include/ports/SkTypeface_win.h" | 61 #include "third_party/skia/include/ports/SkTypeface_win.h" |
62 #include "ui/gfx/win/direct_write.h" | 62 #include "ui/gfx/win/direct_write.h" |
63 #endif | 63 #endif |
64 | 64 |
65 using blink::WebDeviceMotionData; | 65 using device::MotionData; |
66 using blink::WebDeviceOrientationData; | 66 using device::OrientationData; |
67 using blink::WebGamepad; | 67 using blink::WebGamepad; |
68 using blink::WebGamepads; | 68 using blink::WebGamepads; |
69 using blink::WebRect; | 69 using blink::WebRect; |
70 using blink::WebSize; | 70 using blink::WebSize; |
71 | 71 |
72 namespace content { | 72 namespace content { |
73 | 73 |
74 namespace { | 74 namespace { |
75 | 75 |
76 base::LazyInstance<ViewProxyCreationCallback>::Leaky | 76 base::LazyInstance<ViewProxyCreationCallback>::Leaky |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 RenderThreadImpl::current() | 264 RenderThreadImpl::current() |
265 ->blink_platform_impl() | 265 ->blink_platform_impl() |
266 ->SetPlatformEventObserverForTesting(blink::WebPlatformEventTypeGamepad, | 266 ->SetPlatformEventObserverForTesting(blink::WebPlatformEventTypeGamepad, |
267 std::move(provider)); | 267 std::move(provider)); |
268 } | 268 } |
269 | 269 |
270 void SetMockDeviceLightData(const double data) { | 270 void SetMockDeviceLightData(const double data) { |
271 RendererBlinkPlatformImpl::SetMockDeviceLightDataForTesting(data); | 271 RendererBlinkPlatformImpl::SetMockDeviceLightDataForTesting(data); |
272 } | 272 } |
273 | 273 |
274 void SetMockDeviceMotionData(const WebDeviceMotionData& data) { | 274 void SetMockDeviceMotionData(const MotionData& data) { |
275 RendererBlinkPlatformImpl::SetMockDeviceMotionDataForTesting(data); | 275 RendererBlinkPlatformImpl::SetMockDeviceMotionDataForTesting(data); |
276 } | 276 } |
277 | 277 |
278 void SetMockDeviceOrientationData(const WebDeviceOrientationData& data) { | 278 void SetMockDeviceOrientationData(const OrientationData& data) { |
279 RendererBlinkPlatformImpl::SetMockDeviceOrientationDataForTesting(data); | 279 RendererBlinkPlatformImpl::SetMockDeviceOrientationDataForTesting(data); |
280 } | 280 } |
281 | 281 |
282 namespace { | 282 namespace { |
283 | 283 |
284 // Invokes a callback on commit (on the main thread) to obtain the output | 284 // Invokes a callback on commit (on the main thread) to obtain the output |
285 // surface that should be used, then asks that output surface to submit the copy | 285 // surface that should be used, then asks that output surface to submit the copy |
286 // request at SwapBuffers time. | 286 // request at SwapBuffers time. |
287 class CopyRequestSwapPromise : public cc::SwapPromise { | 287 class CopyRequestSwapPromise : public cc::SwapPromise { |
288 public: | 288 public: |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 return result; | 1104 return result; |
1105 } | 1105 } |
1106 | 1106 |
1107 void SchedulerRunIdleTasks(const base::Closure& callback) { | 1107 void SchedulerRunIdleTasks(const base::Closure& callback) { |
1108 blink::scheduler::RendererScheduler* scheduler = | 1108 blink::scheduler::RendererScheduler* scheduler = |
1109 content::RenderThreadImpl::current()->GetRendererScheduler(); | 1109 content::RenderThreadImpl::current()->GetRendererScheduler(); |
1110 blink::scheduler::RunIdleTasksForTesting(scheduler, callback); | 1110 blink::scheduler::RunIdleTasksForTesting(scheduler, callback); |
1111 } | 1111 } |
1112 | 1112 |
1113 } // namespace content | 1113 } // namespace content |
OLD | NEW |