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_adapter_factory_wrapper.h" | |
19 #include "content/browser/renderer_host/render_process_host_impl.h" | 18 #include "content/browser/renderer_host/render_process_host_impl.h" |
20 #include "content/browser/renderer_host/render_widget_host_impl.h" | 19 #include "content/browser/renderer_host/render_widget_host_impl.h" |
21 #include "content/common/site_isolation_policy.h" | 20 #include "content/common/site_isolation_policy.h" |
22 #include "content/public/common/page_state.h" | 21 #include "content/public/common/page_state.h" |
23 #include "content/public/renderer/renderer_gamepad_provider.h" | 22 #include "content/public/renderer/renderer_gamepad_provider.h" |
24 #include "content/renderer/fetchers/manifest_fetcher.h" | 23 #include "content/renderer/fetchers/manifest_fetcher.h" |
25 #include "content/renderer/history_entry.h" | 24 #include "content/renderer/history_entry.h" |
26 #include "content/renderer/history_serialization.h" | 25 #include "content/renderer/history_serialization.h" |
27 #include "content/renderer/render_frame_impl.h" | 26 #include "content/renderer/render_frame_impl.h" |
28 #include "content/renderer/render_thread_impl.h" | 27 #include "content/renderer/render_thread_impl.h" |
29 #include "content/renderer/render_view_impl.h" | 28 #include "content/renderer/render_view_impl.h" |
30 #include "content/renderer/renderer_blink_platform_impl.h" | 29 #include "content/renderer/renderer_blink_platform_impl.h" |
31 #include "content/shell/common/shell_switches.h" | 30 #include "content/shell/common/shell_switches.h" |
32 #include "device/bluetooth/bluetooth_adapter.h" | |
33 #include "gpu/ipc/service/image_transport_surface.h" | 31 #include "gpu/ipc/service/image_transport_surface.h" |
34 #include "third_party/WebKit/public/platform/WebGamepads.h" | 32 #include "third_party/WebKit/public/platform/WebGamepads.h" |
35 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionData.h" | 33 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionData.h" |
36 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationData.h" | 34 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationData.h" |
37 #include "third_party/WebKit/public/web/WebHistoryItem.h" | 35 #include "third_party/WebKit/public/web/WebHistoryItem.h" |
38 #include "third_party/WebKit/public/web/WebView.h" | 36 #include "third_party/WebKit/public/web/WebView.h" |
39 | 37 |
40 #if defined(OS_MACOSX) | 38 #if defined(OS_MACOSX) |
41 #include "content/browser/frame_host/popup_menu_helper_mac.h" | 39 #include "content/browser/frame_host/popup_menu_helper_mac.h" |
42 #elif defined(OS_WIN) | 40 #elif defined(OS_WIN) |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 TestColorProfile test; | 344 TestColorProfile test; |
347 color_profile.assign(test.data(), test.data() + test.size()); | 345 color_profile.assign(test.data(), test.data() + test.size()); |
348 } else if (name == "adobeRGB") { | 346 } else if (name == "adobeRGB") { |
349 AdobeRGBColorProfile test; | 347 AdobeRGBColorProfile test; |
350 color_profile.assign(test.data(), test.data() + test.size()); | 348 color_profile.assign(test.data(), test.data() + test.size()); |
351 } | 349 } |
352 | 350 |
353 render_view->GetWidget()->SetDeviceColorProfileForTesting(color_profile); | 351 render_view->GetWidget()->SetDeviceColorProfileForTesting(color_profile); |
354 } | 352 } |
355 | 353 |
356 void SetBluetoothAdapter(int render_process_id, | |
357 scoped_refptr<device::BluetoothAdapter> adapter) { | |
358 RenderProcessHostImpl* render_process_host_impl = | |
359 static_cast<RenderProcessHostImpl*>( | |
360 RenderProcessHost::FromID(render_process_id)); | |
361 | |
362 render_process_host_impl->GetBluetoothAdapterFactoryWrapper() | |
363 ->SetBluetoothAdapterForTesting(std::move(adapter)); | |
364 } | |
365 | |
366 void UseSynchronousResizeMode(RenderView* render_view, bool enable) { | 354 void UseSynchronousResizeMode(RenderView* render_view, bool enable) { |
367 static_cast<RenderViewImpl*>(render_view)-> | 355 static_cast<RenderViewImpl*>(render_view)-> |
368 UseSynchronousResizeModeForTesting(enable); | 356 UseSynchronousResizeModeForTesting(enable); |
369 } | 357 } |
370 | 358 |
371 void EnableAutoResizeMode(RenderView* render_view, | 359 void EnableAutoResizeMode(RenderView* render_view, |
372 const WebSize& min_size, | 360 const WebSize& min_size, |
373 const WebSize& max_size) { | 361 const WebSize& max_size) { |
374 static_cast<RenderViewImpl*>(render_view)-> | 362 static_cast<RenderViewImpl*>(render_view)-> |
375 EnableAutoResizeForTesting(min_size, max_size); | 363 EnableAutoResizeForTesting(min_size, max_size); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 return result; | 425 return result; |
438 } | 426 } |
439 | 427 |
440 void SchedulerRunIdleTasks(const base::Closure& callback) { | 428 void SchedulerRunIdleTasks(const base::Closure& callback) { |
441 scheduler::RendererScheduler* scheduler = | 429 scheduler::RendererScheduler* scheduler = |
442 content::RenderThreadImpl::current()->GetRendererScheduler(); | 430 content::RenderThreadImpl::current()->GetRendererScheduler(); |
443 scheduler::RunIdleTasksForTesting(scheduler, callback); | 431 scheduler::RunIdleTasksForTesting(scheduler, callback); |
444 } | 432 } |
445 | 433 |
446 } // namespace content | 434 } // namespace content |
OLD | NEW |