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 BluetoothDispatcherHost* dispatcher_host = render_process_host_impl | 323 BluetoothDispatcherHost* dispatcher_host = |
322 ->GetBluetoothDispatcherHost(); | 324 render_process_host_impl->GetBluetoothDispatcherHost(); |
323 | 325 |
324 if (dispatcher_host != NULL) | 326 if (dispatcher_host != NULL) |
325 dispatcher_host->SetBluetoothAdapterForTesting(name); | 327 dispatcher_host->SetBluetoothAdapterForTesting(adapter.Pass()); |
326 } | 328 } |
327 | 329 |
328 void SetGeofencingMockProvider(bool service_available) { | 330 void SetGeofencingMockProvider(bool service_available) { |
329 static_cast<WebGeofencingProviderImpl*>( | 331 static_cast<WebGeofencingProviderImpl*>( |
330 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider()) | 332 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider()) |
331 ->SetMockProvider(service_available); | 333 ->SetMockProvider(service_available); |
332 } | 334 } |
333 | 335 |
334 void ClearGeofencingMockProvider() { | 336 void ClearGeofencingMockProvider() { |
335 static_cast<WebGeofencingProviderImpl*>( | 337 static_cast<WebGeofencingProviderImpl*>( |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 } | 422 } |
421 result.append("===============================================\n"); | 423 result.append("===============================================\n"); |
422 return result; | 424 return result; |
423 } | 425 } |
424 | 426 |
425 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) { | 427 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) { |
426 return new cc_blink::WebLayerImpl(layer); | 428 return new cc_blink::WebLayerImpl(layer); |
427 } | 429 } |
428 | 430 |
429 } // namespace content | 431 } // namespace content |
OLD | NEW |