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" | |
11 #include "content/browser/renderer_host/render_process_host_impl.h" | |
12 #include "content/browser/renderer_host/render_widget_host_impl.h" | 10 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 11 #include "content/child/bluetooth/web_bluetooth_impl.h" |
13 #include "content/child/geofencing/web_geofencing_provider_impl.h" | 12 #include "content/child/geofencing/web_geofencing_provider_impl.h" |
14 #include "content/common/gpu/image_transport_surface.h" | 13 #include "content/common/gpu/image_transport_surface.h" |
15 #include "content/public/common/page_state.h" | 14 #include "content/public/common/page_state.h" |
16 #include "content/public/renderer/renderer_gamepad_provider.h" | 15 #include "content/public/renderer/renderer_gamepad_provider.h" |
17 #include "content/renderer/fetchers/manifest_fetcher.h" | 16 #include "content/renderer/fetchers/manifest_fetcher.h" |
18 #include "content/renderer/history_entry.h" | 17 #include "content/renderer/history_entry.h" |
19 #include "content/renderer/history_serialization.h" | 18 #include "content/renderer/history_serialization.h" |
20 #include "content/renderer/render_frame_impl.h" | 19 #include "content/renderer/render_frame_impl.h" |
21 #include "content/renderer/render_thread_impl.h" | 20 #include "content/renderer/render_thread_impl.h" |
22 #include "content/renderer/render_view_impl.h" | 21 #include "content/renderer/render_view_impl.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 color_profile.assign(test.data(), test.data() + test.size()); | 305 color_profile.assign(test.data(), test.data() + test.size()); |
307 } else if (name == "adobeRGB") { | 306 } else if (name == "adobeRGB") { |
308 AdobeRGBColorProfile test; | 307 AdobeRGBColorProfile test; |
309 color_profile.assign(test.data(), test.data() + test.size()); | 308 color_profile.assign(test.data(), test.data() + test.size()); |
310 } | 309 } |
311 | 310 |
312 static_cast<RenderViewImpl*>(render_view)-> | 311 static_cast<RenderViewImpl*>(render_view)-> |
313 SetDeviceColorProfileForTesting(color_profile); | 312 SetDeviceColorProfileForTesting(color_profile); |
314 } | 313 } |
315 | 314 |
316 void SetBluetoothAdapter(int render_process_id, const std::string& name) { | 315 void SetBluetoothMockDataSetForTesting(const std::string& name) { |
317 RenderProcessHostImpl* render_process_host_impl = | 316 RenderThreadImpl::current() |
318 static_cast<RenderProcessHostImpl*>( | 317 ->blink_platform_impl() |
319 RenderProcessHost::FromID(render_process_id)); | 318 ->BluetoothImplForTesting() |
320 | 319 ->SetBluetoothMockDataSetForTesting(name); |
321 render_process_host_impl | |
322 ->GetBluetoothDispatcherHost() | |
323 ->SetBluetoothAdapterForTesting(name); | |
324 } | 320 } |
325 | 321 |
326 void SetGeofencingMockProvider(bool service_available) { | 322 void SetGeofencingMockProvider(bool service_available) { |
327 static_cast<WebGeofencingProviderImpl*>( | 323 static_cast<WebGeofencingProviderImpl*>( |
328 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider()) | 324 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider()) |
329 ->SetMockProvider(service_available); | 325 ->SetMockProvider(service_available); |
330 } | 326 } |
331 | 327 |
332 void ClearGeofencingMockProvider() { | 328 void ClearGeofencingMockProvider() { |
333 static_cast<WebGeofencingProviderImpl*>( | 329 static_cast<WebGeofencingProviderImpl*>( |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 } | 414 } |
419 result.append("===============================================\n"); | 415 result.append("===============================================\n"); |
420 return result; | 416 return result; |
421 } | 417 } |
422 | 418 |
423 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) { | 419 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) { |
424 return new cc_blink::WebLayerImpl(layer); | 420 return new cc_blink::WebLayerImpl(layer); |
425 } | 421 } |
426 | 422 |
427 } // namespace content | 423 } // namespace content |
OLD | NEW |