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 13 matching lines...) Expand all Loading... |
24 #include "content/public/renderer/renderer_gamepad_provider.h" | 24 #include "content/public/renderer/renderer_gamepad_provider.h" |
25 #include "content/renderer/fetchers/manifest_fetcher.h" | 25 #include "content/renderer/fetchers/manifest_fetcher.h" |
26 #include "content/renderer/history_entry.h" | 26 #include "content/renderer/history_entry.h" |
27 #include "content/renderer/history_serialization.h" | 27 #include "content/renderer/history_serialization.h" |
28 #include "content/renderer/render_frame_impl.h" | 28 #include "content/renderer/render_frame_impl.h" |
29 #include "content/renderer/render_thread_impl.h" | 29 #include "content/renderer/render_thread_impl.h" |
30 #include "content/renderer/render_view_impl.h" | 30 #include "content/renderer/render_view_impl.h" |
31 #include "content/renderer/renderer_blink_platform_impl.h" | 31 #include "content/renderer/renderer_blink_platform_impl.h" |
32 #include "content/shell/common/shell_switches.h" | 32 #include "content/shell/common/shell_switches.h" |
33 #include "device/bluetooth/bluetooth_adapter.h" | 33 #include "device/bluetooth/bluetooth_adapter.h" |
| 34 #include "third_party/WebKit/public/platform/WebBatteryStatus.h" |
34 #include "third_party/WebKit/public/platform/WebGamepads.h" | 35 #include "third_party/WebKit/public/platform/WebGamepads.h" |
35 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionData.h" | 36 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionData.h" |
36 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationData.h" | 37 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationData.h" |
37 #include "third_party/WebKit/public/web/WebHistoryItem.h" | 38 #include "third_party/WebKit/public/web/WebHistoryItem.h" |
38 #include "third_party/WebKit/public/web/WebView.h" | 39 #include "third_party/WebKit/public/web/WebView.h" |
39 | 40 |
40 #if defined(OS_MACOSX) | 41 #if defined(OS_MACOSX) |
41 #include "content/browser/frame_host/popup_menu_helper_mac.h" | 42 #include "content/browser/frame_host/popup_menu_helper_mac.h" |
42 #elif defined(OS_WIN) | 43 #elif defined(OS_WIN) |
43 #include "content/child/font_warmup_win.h" | 44 #include "content/child/font_warmup_win.h" |
44 #include "content/public/common/dwrite_font_platform_win.h" | 45 #include "content/public/common/dwrite_font_platform_win.h" |
45 #include "third_party/WebKit/public/web/win/WebFontRendering.h" | 46 #include "third_party/WebKit/public/web/win/WebFontRendering.h" |
46 #include "third_party/skia/include/ports/SkFontMgr.h" | 47 #include "third_party/skia/include/ports/SkFontMgr.h" |
47 #include "third_party/skia/include/ports/SkTypeface_win.h" | 48 #include "third_party/skia/include/ports/SkTypeface_win.h" |
48 #include "ui/gfx/win/direct_write.h" | 49 #include "ui/gfx/win/direct_write.h" |
49 #endif | 50 #endif |
50 | 51 |
| 52 using blink::WebBatteryStatus; |
51 using blink::WebDeviceMotionData; | 53 using blink::WebDeviceMotionData; |
52 using blink::WebDeviceOrientationData; | 54 using blink::WebDeviceOrientationData; |
53 using blink::WebGamepad; | 55 using blink::WebGamepad; |
54 using blink::WebGamepads; | 56 using blink::WebGamepads; |
55 using blink::WebRect; | 57 using blink::WebRect; |
56 using blink::WebSize; | 58 using blink::WebSize; |
57 | 59 |
58 namespace content { | 60 namespace content { |
59 | 61 |
60 namespace { | 62 namespace { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 } | 160 } |
159 | 161 |
160 void SetMockDeviceMotionData(const WebDeviceMotionData& data) { | 162 void SetMockDeviceMotionData(const WebDeviceMotionData& data) { |
161 RendererBlinkPlatformImpl::SetMockDeviceMotionDataForTesting(data); | 163 RendererBlinkPlatformImpl::SetMockDeviceMotionDataForTesting(data); |
162 } | 164 } |
163 | 165 |
164 void SetMockDeviceOrientationData(const WebDeviceOrientationData& data) { | 166 void SetMockDeviceOrientationData(const WebDeviceOrientationData& data) { |
165 RendererBlinkPlatformImpl::SetMockDeviceOrientationDataForTesting(data); | 167 RendererBlinkPlatformImpl::SetMockDeviceOrientationDataForTesting(data); |
166 } | 168 } |
167 | 169 |
| 170 void MockBatteryStatusChanged(const WebBatteryStatus& status) { |
| 171 RenderThreadImpl::current() |
| 172 ->blink_platform_impl() |
| 173 ->MockBatteryStatusChangedForTesting(status); |
| 174 } |
| 175 |
168 void EnableRendererLayoutTestMode() { | 176 void EnableRendererLayoutTestMode() { |
169 RenderThreadImpl::current()->set_layout_test_mode(true); | 177 RenderThreadImpl::current()->set_layout_test_mode(true); |
170 | 178 |
171 #if defined(OS_WIN) | 179 #if defined(OS_WIN) |
172 if (gfx::win::ShouldUseDirectWrite()) { | 180 if (gfx::win::ShouldUseDirectWrite()) { |
173 if (ShouldUseDirectWriteFontProxyFieldTrial()) | 181 if (ShouldUseDirectWriteFontProxyFieldTrial()) |
174 RegisterSideloadedTypefaces(SkFontMgr_New_DirectWrite()); | 182 RegisterSideloadedTypefaces(SkFontMgr_New_DirectWrite()); |
175 else | 183 else |
176 RegisterSideloadedTypefaces(GetPreSandboxWarmupFontMgr()); | 184 RegisterSideloadedTypefaces(GetPreSandboxWarmupFontMgr()); |
177 } | 185 } |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 result.append( | 461 result.append( |
454 DumpHistoryItem(entry->root_history_node(), | 462 DumpHistoryItem(entry->root_history_node(), |
455 8, | 463 8, |
456 index == current_index)); | 464 index == current_index)); |
457 } | 465 } |
458 result.append("===============================================\n"); | 466 result.append("===============================================\n"); |
459 return result; | 467 return result; |
460 } | 468 } |
461 | 469 |
462 } // namespace content | 470 } // namespace content |
OLD | NEW |