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