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/common/site_isolation_policy.h" | 21 #include "content/common/site_isolation_policy.h" |
22 #include "content/public/common/page_state.h" | 22 #include "content/public/common/page_state.h" |
23 #include "content/public/renderer/renderer_gamepad_provider.h" | 23 #include "content/public/renderer/renderer_gamepad_provider.h" |
24 #include "content/renderer/fetchers/manifest_fetcher.h" | 24 #include "content/renderer/fetchers/manifest_fetcher.h" |
25 #include "content/renderer/history_entry.h" | 25 #include "content/renderer/history_entry.h" |
26 #include "content/renderer/history_serialization.h" | 26 #include "content/renderer/history_serialization.h" |
27 #include "content/renderer/render_frame_impl.h" | 27 #include "content/renderer/render_frame_impl.h" |
28 #include "content/renderer/render_thread_impl.h" | 28 #include "content/renderer/render_thread_impl.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 352 |
353 render_view->GetWidget()->SetDeviceColorProfileForTesting(color_profile); | 353 render_view->GetWidget()->SetDeviceColorProfileForTesting(color_profile); |
354 } | 354 } |
355 | 355 |
356 void SetBluetoothAdapter(int render_process_id, | 356 void SetBluetoothAdapter(int render_process_id, |
357 scoped_refptr<device::BluetoothAdapter> adapter) { | 357 scoped_refptr<device::BluetoothAdapter> adapter) { |
358 RenderProcessHostImpl* render_process_host_impl = | 358 RenderProcessHostImpl* render_process_host_impl = |
359 static_cast<RenderProcessHostImpl*>( | 359 static_cast<RenderProcessHostImpl*>( |
360 RenderProcessHost::FromID(render_process_id)); | 360 RenderProcessHost::FromID(render_process_id)); |
361 | 361 |
362 BluetoothDispatcherHost* dispatcher_host = | 362 render_process_host_impl->GetBluetoothAdapterFactoryWrapper() |
363 render_process_host_impl->GetBluetoothDispatcherHost(); | 363 ->SetBluetoothAdapterForTesting(std::move(adapter)); |
364 | |
365 if (dispatcher_host != NULL) | |
366 dispatcher_host->SetBluetoothAdapterForTesting(std::move(adapter)); | |
367 } | 364 } |
368 | 365 |
369 void UseSynchronousResizeMode(RenderView* render_view, bool enable) { | 366 void UseSynchronousResizeMode(RenderView* render_view, bool enable) { |
370 static_cast<RenderViewImpl*>(render_view)-> | 367 static_cast<RenderViewImpl*>(render_view)-> |
371 UseSynchronousResizeModeForTesting(enable); | 368 UseSynchronousResizeModeForTesting(enable); |
372 } | 369 } |
373 | 370 |
374 void EnableAutoResizeMode(RenderView* render_view, | 371 void EnableAutoResizeMode(RenderView* render_view, |
375 const WebSize& min_size, | 372 const WebSize& min_size, |
376 const WebSize& max_size) { | 373 const WebSize& max_size) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 return result; | 437 return result; |
441 } | 438 } |
442 | 439 |
443 void SchedulerRunIdleTasks(const base::Closure& callback) { | 440 void SchedulerRunIdleTasks(const base::Closure& callback) { |
444 scheduler::RendererScheduler* scheduler = | 441 scheduler::RendererScheduler* scheduler = |
445 content::RenderThreadImpl::current()->GetRendererScheduler(); | 442 content::RenderThreadImpl::current()->GetRendererScheduler(); |
446 scheduler::RunIdleTasksForTesting(scheduler, callback); | 443 scheduler::RunIdleTasksForTesting(scheduler, callback); |
447 } | 444 } |
448 | 445 |
449 } // namespace content | 446 } // namespace content |
OLD | NEW |