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/render_view_test.h" | 5 #include "content/public/test/render_view_test.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cctype> | 9 #include <cctype> |
10 | 10 |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
16 #include "components/scheduler/renderer/renderer_scheduler.h" | |
17 #include "content/app/mojo/mojo_init.h" | 16 #include "content/app/mojo/mojo_init.h" |
18 #include "content/common/dom_storage/dom_storage_types.h" | 17 #include "content/common/dom_storage/dom_storage_types.h" |
19 #include "content/common/frame_messages.h" | 18 #include "content/common/frame_messages.h" |
20 #include "content/common/input_messages.h" | 19 #include "content/common/input_messages.h" |
21 #include "content/common/resize_params.h" | 20 #include "content/common/resize_params.h" |
22 #include "content/common/site_isolation_policy.h" | 21 #include "content/common/site_isolation_policy.h" |
23 #include "content/common/view_messages.h" | 22 #include "content/common/view_messages.h" |
24 #include "content/public/browser/content_browser_client.h" | 23 #include "content/public/browser/content_browser_client.h" |
25 #include "content/public/browser/native_web_keyboard_event.h" | 24 #include "content/public/browser/native_web_keyboard_event.h" |
26 #include "content/public/common/content_client.h" | 25 #include "content/public/common/content_client.h" |
27 #include "content/public/common/renderer_preferences.h" | 26 #include "content/public/common/renderer_preferences.h" |
28 #include "content/public/renderer/content_renderer_client.h" | 27 #include "content/public/renderer/content_renderer_client.h" |
29 #include "content/public/test/frame_load_waiter.h" | 28 #include "content/public/test/frame_load_waiter.h" |
30 #include "content/renderer/history_controller.h" | 29 #include "content/renderer/history_controller.h" |
31 #include "content/renderer/history_serialization.h" | 30 #include "content/renderer/history_serialization.h" |
32 #include "content/renderer/render_thread_impl.h" | 31 #include "content/renderer/render_thread_impl.h" |
33 #include "content/renderer/render_view_impl.h" | 32 #include "content/renderer/render_view_impl.h" |
34 #include "content/renderer/renderer_blink_platform_impl.h" | 33 #include "content/renderer/renderer_blink_platform_impl.h" |
35 #include "content/renderer/renderer_main_platform_delegate.h" | 34 #include "content/renderer/renderer_main_platform_delegate.h" |
36 #include "content/test/fake_compositor_dependencies.h" | 35 #include "content/test/fake_compositor_dependencies.h" |
37 #include "content/test/mock_render_process.h" | 36 #include "content/test/mock_render_process.h" |
38 #include "content/test/test_content_client.h" | 37 #include "content/test/test_content_client.h" |
39 #include "content/test/test_render_frame.h" | 38 #include "content/test/test_render_frame.h" |
40 #include "third_party/WebKit/public/platform/WebScreenInfo.h" | 39 #include "third_party/WebKit/public/platform/WebScreenInfo.h" |
41 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 40 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
42 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 41 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 42 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
43 #include "third_party/WebKit/public/web/WebDocument.h" | 43 #include "third_party/WebKit/public/web/WebDocument.h" |
44 #include "third_party/WebKit/public/web/WebHistoryItem.h" | 44 #include "third_party/WebKit/public/web/WebHistoryItem.h" |
45 #include "third_party/WebKit/public/web/WebInputElement.h" | 45 #include "third_party/WebKit/public/web/WebInputElement.h" |
46 #include "third_party/WebKit/public/web/WebInputEvent.h" | 46 #include "third_party/WebKit/public/web/WebInputEvent.h" |
47 #include "third_party/WebKit/public/web/WebKit.h" | 47 #include "third_party/WebKit/public/web/WebKit.h" |
48 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 48 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
49 #include "third_party/WebKit/public/web/WebScriptSource.h" | 49 #include "third_party/WebKit/public/web/WebScriptSource.h" |
50 #include "third_party/WebKit/public/web/WebView.h" | 50 #include "third_party/WebKit/public/web/WebView.h" |
51 #include "ui/base/resource/resource_bundle.h" | 51 #include "ui/base/resource/resource_bundle.h" |
52 #include "ui/events/keycodes/keyboard_codes.h" | 52 #include "ui/events/keycodes/keyboard_codes.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } | 108 } |
109 | 109 |
110 } // namespace | 110 } // namespace |
111 | 111 |
112 namespace content { | 112 namespace content { |
113 | 113 |
114 class RendererBlinkPlatformImplTestOverrideImpl | 114 class RendererBlinkPlatformImplTestOverrideImpl |
115 : public RendererBlinkPlatformImpl { | 115 : public RendererBlinkPlatformImpl { |
116 public: | 116 public: |
117 RendererBlinkPlatformImplTestOverrideImpl( | 117 RendererBlinkPlatformImplTestOverrideImpl( |
118 scheduler::RendererScheduler* scheduler) | 118 blink::scheduler::RendererScheduler* scheduler) |
119 : RendererBlinkPlatformImpl(scheduler, nullptr) { | 119 : RendererBlinkPlatformImpl(scheduler, nullptr) {} |
120 } | |
121 | 120 |
122 // Get rid of the dependency to the sandbox, which is not available in | 121 // Get rid of the dependency to the sandbox, which is not available in |
123 // RenderViewTest. | 122 // RenderViewTest. |
124 blink::WebSandboxSupport* sandboxSupport() override { return NULL; } | 123 blink::WebSandboxSupport* sandboxSupport() override { return NULL; } |
125 }; | 124 }; |
126 | 125 |
127 RenderViewTest::RendererBlinkPlatformImplTestOverride:: | 126 RenderViewTest::RendererBlinkPlatformImplTestOverride:: |
128 RendererBlinkPlatformImplTestOverride() { | 127 RendererBlinkPlatformImplTestOverride() { |
129 renderer_scheduler_ = scheduler::RendererScheduler::Create(); | 128 renderer_scheduler_ = blink::scheduler::RendererScheduler::Create(); |
130 blink_platform_impl_.reset( | 129 blink_platform_impl_.reset( |
131 new RendererBlinkPlatformImplTestOverrideImpl(renderer_scheduler_.get())); | 130 new RendererBlinkPlatformImplTestOverrideImpl(renderer_scheduler_.get())); |
132 } | 131 } |
133 | 132 |
134 RenderViewTest::RendererBlinkPlatformImplTestOverride:: | 133 RenderViewTest::RendererBlinkPlatformImplTestOverride:: |
135 ~RendererBlinkPlatformImplTestOverride() { | 134 ~RendererBlinkPlatformImplTestOverride() { |
136 } | 135 } |
137 | 136 |
138 blink::Platform* | 137 blink::Platform* |
139 RenderViewTest::RendererBlinkPlatformImplTestOverride::Get() const { | 138 RenderViewTest::RendererBlinkPlatformImplTestOverride::Get() const { |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 667 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
669 frame->Navigate(common_params, StartNavigationParams(), request_params); | 668 frame->Navigate(common_params, StartNavigationParams(), request_params); |
670 | 669 |
671 // The load actually happens asynchronously, so we pump messages to process | 670 // The load actually happens asynchronously, so we pump messages to process |
672 // the pending continuation. | 671 // the pending continuation. |
673 FrameLoadWaiter(frame).Wait(); | 672 FrameLoadWaiter(frame).Wait(); |
674 view_->GetWebView()->updateAllLifecyclePhases(); | 673 view_->GetWebView()->updateAllLifecyclePhases(); |
675 } | 674 } |
676 | 675 |
677 } // namespace content | 676 } // namespace content |
OLD | NEW |