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 "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "cc/blink/web_layer_impl.h" | 9 #include "cc/blink/web_layer_impl.h" |
10 #include "content/browser/bluetooth/bluetooth_dispatcher_host.h" | 10 #include "content/browser/bluetooth/bluetooth_dispatcher_host.h" |
11 #include "content/browser/renderer_host/render_process_host_impl.h" | 11 #include "content/browser/renderer_host/render_process_host_impl.h" |
12 #include "content/browser/renderer_host/render_widget_host_impl.h" | 12 #include "content/browser/renderer_host/render_widget_host_impl.h" |
13 #include "content/child/geofencing/web_geofencing_provider_impl.h" | 13 #include "content/child/geofencing/web_geofencing_provider_impl.h" |
14 #include "content/common/gpu/image_transport_surface.h" | 14 #include "content/common/gpu/image_transport_surface.h" |
15 #include "content/public/common/page_state.h" | 15 #include "content/public/common/page_state.h" |
16 #include "content/public/renderer/renderer_gamepad_provider.h" | 16 #include "content/public/renderer/renderer_gamepad_provider.h" |
17 #include "content/renderer/fetchers/manifest_fetcher.h" | 17 #include "content/renderer/fetchers/manifest_fetcher.h" |
18 #include "content/renderer/history_entry.h" | 18 #include "content/renderer/history_entry.h" |
19 #include "content/renderer/history_serialization.h" | 19 #include "content/renderer/history_serialization.h" |
20 #include "content/renderer/render_frame_impl.h" | 20 #include "content/renderer/render_frame_impl.h" |
21 #include "content/renderer/render_thread_impl.h" | 21 #include "content/renderer/render_thread_impl.h" |
22 #include "content/renderer/render_view_impl.h" | 22 #include "content/renderer/render_view_impl.h" |
23 #include "content/renderer/renderer_blink_platform_impl.h" | 23 #include "content/renderer/renderer_blink_platform_impl.h" |
24 #include "content/shell/renderer/test_runner/test_common.h" | 24 #include "content/shell/renderer/test_runner/test_common.h" |
25 #include "content/shell/renderer/test_runner/web_frame_test_proxy.h" | 25 #include "content/shell/renderer/test_runner/web_frame_test_proxy.h" |
26 #include "content/shell/renderer/test_runner/web_test_proxy.h" | 26 #include "content/shell/renderer/test_runner/web_test_proxy.h" |
| 27 #include "device/bluetooth/bluetooth_adapter.h" |
27 #include "third_party/WebKit/public/platform/WebBatteryStatus.h" | 28 #include "third_party/WebKit/public/platform/WebBatteryStatus.h" |
28 #include "third_party/WebKit/public/platform/WebGamepads.h" | 29 #include "third_party/WebKit/public/platform/WebGamepads.h" |
29 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionData.h" | 30 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionData.h" |
30 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationData.h" | 31 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationData.h" |
31 #include "third_party/WebKit/public/web/WebHistoryItem.h" | 32 #include "third_party/WebKit/public/web/WebHistoryItem.h" |
32 #include "third_party/WebKit/public/web/WebView.h" | 33 #include "third_party/WebKit/public/web/WebView.h" |
33 | 34 |
34 #if defined(OS_MACOSX) | 35 #if defined(OS_MACOSX) |
35 #include "content/browser/frame_host/popup_menu_helper_mac.h" | 36 #include "content/browser/frame_host/popup_menu_helper_mac.h" |
36 #endif | 37 #endif |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 color_profile.assign(test.data(), test.data() + test.size()); | 307 color_profile.assign(test.data(), test.data() + test.size()); |
307 } else if (name == "adobeRGB") { | 308 } else if (name == "adobeRGB") { |
308 AdobeRGBColorProfile test; | 309 AdobeRGBColorProfile test; |
309 color_profile.assign(test.data(), test.data() + test.size()); | 310 color_profile.assign(test.data(), test.data() + test.size()); |
310 } | 311 } |
311 | 312 |
312 static_cast<RenderViewImpl*>(render_view)-> | 313 static_cast<RenderViewImpl*>(render_view)-> |
313 SetDeviceColorProfileForTesting(color_profile); | 314 SetDeviceColorProfileForTesting(color_profile); |
314 } | 315 } |
315 | 316 |
316 void SetBluetoothAdapter(int render_process_id, const std::string& name) { | 317 void SetBluetoothAdapter(int render_process_id, |
| 318 scoped_refptr<device::BluetoothAdapter> adapter) { |
317 RenderProcessHostImpl* render_process_host_impl = | 319 RenderProcessHostImpl* render_process_host_impl = |
318 static_cast<RenderProcessHostImpl*>( | 320 static_cast<RenderProcessHostImpl*>( |
319 RenderProcessHost::FromID(render_process_id)); | 321 RenderProcessHost::FromID(render_process_id)); |
320 | 322 |
321 render_process_host_impl | 323 render_process_host_impl |
322 ->GetBluetoothDispatcherHost() | 324 ->GetBluetoothDispatcherHost() |
323 ->SetBluetoothAdapterForTesting(name); | 325 ->SetBluetoothAdapterForTesting(adapter.Pass()); |
324 } | 326 } |
325 | 327 |
326 void SetGeofencingMockProvider(bool service_available) { | 328 void SetGeofencingMockProvider(bool service_available) { |
327 static_cast<WebGeofencingProviderImpl*>( | 329 static_cast<WebGeofencingProviderImpl*>( |
328 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider()) | 330 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider()) |
329 ->SetMockProvider(service_available); | 331 ->SetMockProvider(service_available); |
330 } | 332 } |
331 | 333 |
332 void ClearGeofencingMockProvider() { | 334 void ClearGeofencingMockProvider() { |
333 static_cast<WebGeofencingProviderImpl*>( | 335 static_cast<WebGeofencingProviderImpl*>( |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 } | 420 } |
419 result.append("===============================================\n"); | 421 result.append("===============================================\n"); |
420 return result; | 422 return result; |
421 } | 423 } |
422 | 424 |
423 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) { | 425 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) { |
424 return new cc_blink::WebLayerImpl(layer); | 426 return new cc_blink::WebLayerImpl(layer); |
425 } | 427 } |
426 | 428 |
427 } // namespace content | 429 } // namespace content |
OLD | NEW |