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/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "cc/test/pixel_test_delegating_output_surface.h" | 15 #include "cc/test/pixel_test_delegating_output_surface.h" |
16 #include "components/scheduler/test/renderer_scheduler_test_support.h" | 16 #include "components/scheduler/test/renderer_scheduler_test_support.h" |
17 #include "components/test_runner/test_common.h" | 17 #include "components/test_runner/test_common.h" |
18 #include "components/test_runner/web_frame_test_proxy.h" | 18 #include "components/test_runner/web_frame_test_proxy.h" |
19 #include "components/test_runner/web_test_proxy.h" | 19 #include "components/test_runner/web_test_proxy.h" |
20 #include "content/browser/bluetooth/bluetooth_adapter_factory_wrapper.h" | 20 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h" |
21 #include "content/browser/renderer_host/render_process_host_impl.h" | 21 #include "content/browser/renderer_host/render_process_host_impl.h" |
22 #include "content/browser/renderer_host/render_widget_host_impl.h" | 22 #include "content/browser/renderer_host/render_widget_host_impl.h" |
23 #include "content/common/gpu/client/context_provider_command_buffer.h" | 23 #include "content/common/gpu/client/context_provider_command_buffer.h" |
24 #include "content/common/site_isolation_policy.h" | 24 #include "content/common/site_isolation_policy.h" |
25 #include "content/public/common/page_state.h" | 25 #include "content/public/common/page_state.h" |
26 #include "content/public/renderer/renderer_gamepad_provider.h" | 26 #include "content/public/renderer/renderer_gamepad_provider.h" |
27 #include "content/renderer/fetchers/manifest_fetcher.h" | 27 #include "content/renderer/fetchers/manifest_fetcher.h" |
28 #include "content/renderer/gpu/render_widget_compositor.h" | 28 #include "content/renderer/gpu/render_widget_compositor.h" |
29 #include "content/renderer/history_entry.h" | 29 #include "content/renderer/history_entry.h" |
30 #include "content/renderer/history_serialization.h" | 30 #include "content/renderer/history_serialization.h" |
31 #include "content/renderer/layout_test_dependencies.h" | 31 #include "content/renderer/layout_test_dependencies.h" |
32 #include "content/renderer/render_frame_impl.h" | 32 #include "content/renderer/render_frame_impl.h" |
33 #include "content/renderer/render_thread_impl.h" | 33 #include "content/renderer/render_thread_impl.h" |
34 #include "content/renderer/render_view_impl.h" | 34 #include "content/renderer/render_view_impl.h" |
35 #include "content/renderer/renderer_blink_platform_impl.h" | 35 #include "content/renderer/renderer_blink_platform_impl.h" |
36 #include "content/shell/common/shell_switches.h" | 36 #include "content/shell/common/shell_switches.h" |
37 #include "device/bluetooth/bluetooth_adapter.h" | |
38 #include "gpu/ipc/service/image_transport_surface.h" | 37 #include "gpu/ipc/service/image_transport_surface.h" |
39 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 38 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
40 #include "third_party/WebKit/public/platform/WebGamepads.h" | 39 #include "third_party/WebKit/public/platform/WebGamepads.h" |
41 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionData.h" | 40 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionData.h" |
42 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationData.h" | 41 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationData.h" |
43 #include "third_party/WebKit/public/web/WebHistoryItem.h" | 42 #include "third_party/WebKit/public/web/WebHistoryItem.h" |
44 #include "third_party/WebKit/public/web/WebView.h" | 43 #include "third_party/WebKit/public/web/WebView.h" |
45 | 44 |
46 #if defined(OS_MACOSX) | 45 #if defined(OS_MACOSX) |
47 #include "content/browser/frame_host/popup_menu_helper_mac.h" | 46 #include "content/browser/frame_host/popup_menu_helper_mac.h" |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 TestColorProfile test; | 401 TestColorProfile test; |
403 color_profile.assign(test.data(), test.data() + test.size()); | 402 color_profile.assign(test.data(), test.data() + test.size()); |
404 } else if (name == "adobeRGB") { | 403 } else if (name == "adobeRGB") { |
405 AdobeRGBColorProfile test; | 404 AdobeRGBColorProfile test; |
406 color_profile.assign(test.data(), test.data() + test.size()); | 405 color_profile.assign(test.data(), test.data() + test.size()); |
407 } | 406 } |
408 | 407 |
409 render_view->GetWidget()->SetDeviceColorProfileForTesting(color_profile); | 408 render_view->GetWidget()->SetDeviceColorProfileForTesting(color_profile); |
410 } | 409 } |
411 | 410 |
412 void SetBluetoothAdapter(int render_process_id, | 411 void SetTestBluetoothScanDuration() { |
413 scoped_refptr<device::BluetoothAdapter> adapter) { | 412 BluetoothDeviceChooserController::SetTestScanDurationForTesting(); |
414 RenderProcessHostImpl* render_process_host_impl = | |
415 static_cast<RenderProcessHostImpl*>( | |
416 RenderProcessHost::FromID(render_process_id)); | |
417 | |
418 render_process_host_impl->GetBluetoothAdapterFactoryWrapper() | |
419 ->SetBluetoothAdapterForTesting(std::move(adapter)); | |
420 } | 413 } |
421 | 414 |
422 void UseSynchronousResizeMode(RenderView* render_view, bool enable) { | 415 void UseSynchronousResizeMode(RenderView* render_view, bool enable) { |
423 static_cast<RenderViewImpl*>(render_view)-> | 416 static_cast<RenderViewImpl*>(render_view)-> |
424 UseSynchronousResizeModeForTesting(enable); | 417 UseSynchronousResizeModeForTesting(enable); |
425 } | 418 } |
426 | 419 |
427 void EnableAutoResizeMode(RenderView* render_view, | 420 void EnableAutoResizeMode(RenderView* render_view, |
428 const WebSize& min_size, | 421 const WebSize& min_size, |
429 const WebSize& max_size) { | 422 const WebSize& max_size) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 return result; | 486 return result; |
494 } | 487 } |
495 | 488 |
496 void SchedulerRunIdleTasks(const base::Closure& callback) { | 489 void SchedulerRunIdleTasks(const base::Closure& callback) { |
497 scheduler::RendererScheduler* scheduler = | 490 scheduler::RendererScheduler* scheduler = |
498 content::RenderThreadImpl::current()->GetRendererScheduler(); | 491 content::RenderThreadImpl::current()->GetRendererScheduler(); |
499 scheduler::RunIdleTasksForTesting(scheduler, callback); | 492 scheduler::RunIdleTasksForTesting(scheduler, callback); |
500 } | 493 } |
501 | 494 |
502 } // namespace content | 495 } // namespace content |
OLD | NEW |