| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "components/scheduler/test/renderer_scheduler_test_support.h" | 14 #include "components/scheduler/test/renderer_scheduler_test_support.h" |
| 15 #include "components/test_runner/test_common.h" | 15 #include "components/test_runner/test_common.h" |
| 16 #include "components/test_runner/web_frame_test_proxy.h" | 16 #include "components/test_runner/web_frame_test_proxy.h" |
| 17 #include "components/test_runner/web_test_proxy.h" | 17 #include "components/test_runner/web_test_proxy.h" |
| 18 #include "content/browser/bluetooth/bluetooth_dispatcher_host.h" | 18 #include "content/browser/bluetooth/bluetooth_adapter_factory_wrapper.h" |
| 19 #include "content/browser/renderer_host/render_process_host_impl.h" | 19 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 20 #include "content/browser/renderer_host/render_widget_host_impl.h" | 20 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 21 #include "content/child/geofencing/web_geofencing_provider_impl.h" | 21 #include "content/child/geofencing/web_geofencing_provider_impl.h" |
| 22 #include "content/common/site_isolation_policy.h" | 22 #include "content/common/site_isolation_policy.h" |
| 23 #include "content/public/common/page_state.h" | 23 #include "content/public/common/page_state.h" |
| 24 #include "content/public/renderer/renderer_gamepad_provider.h" | 24 #include "content/public/renderer/renderer_gamepad_provider.h" |
| 25 #include "content/renderer/fetchers/manifest_fetcher.h" | 25 #include "content/renderer/fetchers/manifest_fetcher.h" |
| 26 #include "content/renderer/history_entry.h" | 26 #include "content/renderer/history_entry.h" |
| 27 #include "content/renderer/history_serialization.h" | 27 #include "content/renderer/history_serialization.h" |
| 28 #include "content/renderer/render_frame_impl.h" | 28 #include "content/renderer/render_frame_impl.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 353 |
| 354 render_view->GetWidget()->SetDeviceColorProfileForTesting(color_profile); | 354 render_view->GetWidget()->SetDeviceColorProfileForTesting(color_profile); |
| 355 } | 355 } |
| 356 | 356 |
| 357 void SetBluetoothAdapter(int render_process_id, | 357 void SetBluetoothAdapter(int render_process_id, |
| 358 scoped_refptr<device::BluetoothAdapter> adapter) { | 358 scoped_refptr<device::BluetoothAdapter> adapter) { |
| 359 RenderProcessHostImpl* render_process_host_impl = | 359 RenderProcessHostImpl* render_process_host_impl = |
| 360 static_cast<RenderProcessHostImpl*>( | 360 static_cast<RenderProcessHostImpl*>( |
| 361 RenderProcessHost::FromID(render_process_id)); | 361 RenderProcessHost::FromID(render_process_id)); |
| 362 | 362 |
| 363 BluetoothDispatcherHost* dispatcher_host = | 363 BluetoothAdapterFactoryWrapper* wrapper = |
| 364 render_process_host_impl->GetBluetoothDispatcherHost(); | 364 render_process_host_impl->GetBluetoothAdapterFactoryWrapper(); |
| 365 | 365 |
| 366 if (dispatcher_host != NULL) | 366 if (wrapper != nullptr) |
| 367 dispatcher_host->SetBluetoothAdapterForTesting(std::move(adapter)); | 367 wrapper->SetBluetoothAdapterForTesting(std::move(adapter)); |
| 368 } | 368 } |
| 369 | 369 |
| 370 void SetGeofencingMockProvider(bool service_available) { | 370 void SetGeofencingMockProvider(bool service_available) { |
| 371 static_cast<WebGeofencingProviderImpl*>( | 371 static_cast<WebGeofencingProviderImpl*>( |
| 372 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider()) | 372 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider()) |
| 373 ->SetMockProvider(service_available); | 373 ->SetMockProvider(service_available); |
| 374 } | 374 } |
| 375 | 375 |
| 376 void ClearGeofencingMockProvider() { | 376 void ClearGeofencingMockProvider() { |
| 377 static_cast<WebGeofencingProviderImpl*>( | 377 static_cast<WebGeofencingProviderImpl*>( |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 return result; | 459 return result; |
| 460 } | 460 } |
| 461 | 461 |
| 462 void SchedulerRunIdleTasks(const base::Closure& callback) { | 462 void SchedulerRunIdleTasks(const base::Closure& callback) { |
| 463 scheduler::RendererScheduler* scheduler = | 463 scheduler::RendererScheduler* scheduler = |
| 464 content::RenderThreadImpl::current()->GetRendererScheduler(); | 464 content::RenderThreadImpl::current()->GetRendererScheduler(); |
| 465 scheduler::RunIdleTasksForTesting(scheduler, callback); | 465 scheduler::RunIdleTasksForTesting(scheduler, callback); |
| 466 } | 466 } |
| 467 | 467 |
| 468 } // namespace content | 468 } // namespace content |
| OLD | NEW |