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 "base/threading/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
16 #include "cc/output/copy_output_request.h" | 16 #include "cc/output/copy_output_request.h" |
17 #include "cc/test/pixel_test_output_surface.h" | 17 #include "cc/test/pixel_test_output_surface.h" |
18 #include "cc/test/test_compositor_frame_sink.h" | 18 #include "cc/test/test_compositor_frame_sink.h" |
19 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h" | 19 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h" |
20 #include "content/browser/renderer_host/render_process_host_impl.h" | 20 #include "content/browser/renderer_host/render_process_host_impl.h" |
21 #include "content/browser/renderer_host/render_widget_host_impl.h" | 21 #include "content/browser/renderer_host/render_widget_host_impl.h" |
22 #include "content/child/request_extra_data.h" | 22 #include "content/child/request_extra_data.h" |
23 #include "content/common/gpu_stream_constants.h" | |
24 #include "content/common/renderer.mojom.h" | 23 #include "content/common/renderer.mojom.h" |
25 #include "content/public/common/page_state.h" | 24 #include "content/public/common/page_state.h" |
26 #include "content/public/common/screen_info.h" | 25 #include "content/public/common/screen_info.h" |
27 #include "content/public/renderer/renderer_gamepad_provider.h" | 26 #include "content/public/renderer/renderer_gamepad_provider.h" |
28 #include "content/renderer/fetchers/manifest_fetcher.h" | 27 #include "content/renderer/fetchers/manifest_fetcher.h" |
29 #include "content/renderer/gpu/render_widget_compositor.h" | 28 #include "content/renderer/gpu/render_widget_compositor.h" |
30 #include "content/renderer/history_entry.h" | 29 #include "content/renderer/history_entry.h" |
31 #include "content/renderer/history_serialization.h" | 30 #include "content/renderer/history_serialization.h" |
32 #include "content/renderer/input/render_widget_input_handler_delegate.h" | 31 #include "content/renderer/input/render_widget_input_handler_delegate.h" |
33 #include "content/renderer/layout_test_dependencies.h" | 32 #include "content/renderer/layout_test_dependencies.h" |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 attributes.stencil_size = 0; | 384 attributes.stencil_size = 0; |
386 attributes.samples = 0; | 385 attributes.samples = 0; |
387 attributes.sample_buffers = 0; | 386 attributes.sample_buffers = 0; |
388 attributes.bind_generates_resource = false; | 387 attributes.bind_generates_resource = false; |
389 attributes.lose_context_when_out_of_memory = true; | 388 attributes.lose_context_when_out_of_memory = true; |
390 const bool automatic_flushes = false; | 389 const bool automatic_flushes = false; |
391 const bool support_locking = false; | 390 const bool support_locking = false; |
392 | 391 |
393 auto context_provider = | 392 auto context_provider = |
394 make_scoped_refptr(new ui::ContextProviderCommandBuffer( | 393 make_scoped_refptr(new ui::ContextProviderCommandBuffer( |
395 gpu_channel_, kGpuStreamIdDefault, kGpuStreamPriorityDefault, | 394 gpu_channel_, gpu::GPU_STREAM_DEFAULT, |
396 gpu::kNullSurfaceHandle, | 395 gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, |
397 GURL("chrome://gpu/" | 396 GURL("chrome://gpu/" |
398 "LayoutTestDependenciesImpl::CreateOutputSurface"), | 397 "LayoutTestDependenciesImpl::CreateOutputSurface"), |
399 automatic_flushes, support_locking, gpu::SharedMemoryLimits(), | 398 automatic_flushes, support_locking, gpu::SharedMemoryLimits(), |
400 attributes, nullptr, | 399 attributes, nullptr, |
401 ui::command_buffer_metrics::OFFSCREEN_CONTEXT_FOR_TESTING)); | 400 ui::command_buffer_metrics::OFFSCREEN_CONTEXT_FOR_TESTING)); |
402 context_provider->BindToCurrentThread(); | 401 context_provider->BindToCurrentThread(); |
403 | 402 |
404 bool flipped_output_surface = false; | 403 bool flipped_output_surface = false; |
405 return base::MakeUnique<cc::PixelTestOutputSurface>( | 404 return base::MakeUnique<cc::PixelTestOutputSurface>( |
406 std::move(context_provider), flipped_output_surface); | 405 std::move(context_provider), flipped_output_surface); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 } | 598 } |
600 } | 599 } |
601 | 600 |
602 bool IsNavigationInitiatedByRenderer(const blink::WebURLRequest& request) { | 601 bool IsNavigationInitiatedByRenderer(const blink::WebURLRequest& request) { |
603 RequestExtraData* extra_data = | 602 RequestExtraData* extra_data = |
604 static_cast<RequestExtraData*>(request.GetExtraData()); | 603 static_cast<RequestExtraData*>(request.GetExtraData()); |
605 return extra_data && extra_data->navigation_initiated_by_renderer(); | 604 return extra_data && extra_data->navigation_initiated_by_renderer(); |
606 } | 605 } |
607 | 606 |
608 } // namespace content | 607 } // namespace content |
OLD | NEW |