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, |
scheib
2015/05/16 02:39:14
Only change signature once here and https://codere
ortuno
2015/05/18 17:41:55
Needs to change twice.
| |
318 scoped_refptr<device::BluetoothAdapter> adapter) { | |
317 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 319 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
318 | 320 |
319 RenderProcessHostImpl* render_process_host_impl = | 321 RenderProcessHostImpl* render_process_host_impl = |
320 static_cast<RenderProcessHostImpl*>( | 322 static_cast<RenderProcessHostImpl*>( |
321 RenderProcessHost::FromID(render_process_id)); | 323 RenderProcessHost::FromID(render_process_id)); |
322 DCHECK(render_process_host_impl); | 324 DCHECK(render_process_host_impl); |
323 | 325 |
324 BluetoothDispatcherHost* bdh = | 326 BluetoothDispatcherHost* bdh = |
325 render_process_host_impl->GetBluetoothDispatcherHost(); | 327 render_process_host_impl->GetBluetoothDispatcherHost(); |
326 DCHECK(bdh); | 328 DCHECK(bdh); |
327 | 329 |
328 bdh->SetBluetoothAdapterForTesting(name); | 330 bdh->SetBluetoothAdapterForTesting(adapter.Pass()); |
329 } | 331 } |
330 | 332 |
331 void SetGeofencingMockProvider(bool service_available) { | 333 void SetGeofencingMockProvider(bool service_available) { |
332 static_cast<WebGeofencingProviderImpl*>( | 334 static_cast<WebGeofencingProviderImpl*>( |
333 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider()) | 335 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider()) |
334 ->SetMockProvider(service_available); | 336 ->SetMockProvider(service_available); |
335 } | 337 } |
336 | 338 |
337 void ClearGeofencingMockProvider() { | 339 void ClearGeofencingMockProvider() { |
338 static_cast<WebGeofencingProviderImpl*>( | 340 static_cast<WebGeofencingProviderImpl*>( |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
423 } | 425 } |
424 result.append("===============================================\n"); | 426 result.append("===============================================\n"); |
425 return result; | 427 return result; |
426 } | 428 } |
427 | 429 |
428 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) { | 430 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) { |
429 return new cc_blink::WebLayerImpl(layer); | 431 return new cc_blink::WebLayerImpl(layer); |
430 } | 432 } |
431 | 433 |
432 } // namespace content | 434 } // namespace content |
OLD | NEW |