Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: content/test/layouttest_support.cc

Issue 1125133005: bluetooth: Move testing IPC from BluetoothDispatcher to BlinkTestRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for stable release mode tests Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 RenderProcessHostImpl* render_process_host_impl =
317 ->blink_platform_impl() 318 static_cast<RenderProcessHostImpl*>(
318 ->BluetoothImplForTesting() 319 RenderProcessHost::FromID(render_process_id));
319 ->SetBluetoothMockDataSetForTesting(name); 320
321 BluetoothDispatcherHost* dispatcher_host = render_process_host_impl
322 ->GetBluetoothDispatcherHost();
323
324 if (dispatcher_host != NULL)
scheib 2015/05/20 04:21:27 Just "if (dispatcher_host)" in C++
325 dispatcher_host->SetBluetoothAdapterForTesting(name);
320 } 326 }
321 327
322 void SetGeofencingMockProvider(bool service_available) { 328 void SetGeofencingMockProvider(bool service_available) {
323 static_cast<WebGeofencingProviderImpl*>( 329 static_cast<WebGeofencingProviderImpl*>(
324 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider()) 330 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider())
325 ->SetMockProvider(service_available); 331 ->SetMockProvider(service_available);
326 } 332 }
327 333
328 void ClearGeofencingMockProvider() { 334 void ClearGeofencingMockProvider() {
329 static_cast<WebGeofencingProviderImpl*>( 335 static_cast<WebGeofencingProviderImpl*>(
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 } 420 }
415 result.append("===============================================\n"); 421 result.append("===============================================\n");
416 return result; 422 return result;
417 } 423 }
418 424
419 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) { 425 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) {
420 return new cc_blink::WebLayerImpl(layer); 426 return new cc_blink::WebLayerImpl(layer);
421 } 427 }
422 428
423 } // namespace content 429 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698