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 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "third_party/WebKit/public/web/WebScriptSource.h" | 46 #include "third_party/WebKit/public/web/WebScriptSource.h" |
47 #include "third_party/WebKit/public/web/WebView.h" | 47 #include "third_party/WebKit/public/web/WebView.h" |
48 #include "ui/base/resource/resource_bundle.h" | 48 #include "ui/base/resource/resource_bundle.h" |
49 #include "ui/events/keycodes/keyboard_codes.h" | 49 #include "ui/events/keycodes/keyboard_codes.h" |
50 #include "v8/include/v8.h" | 50 #include "v8/include/v8.h" |
51 | 51 |
52 #if defined(OS_MACOSX) | 52 #if defined(OS_MACOSX) |
53 #include "base/mac/scoped_nsautorelease_pool.h" | 53 #include "base/mac/scoped_nsautorelease_pool.h" |
54 #endif | 54 #endif |
55 | 55 |
| 56 #if defined(OS_WIN) |
| 57 #include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h" |
| 58 #include "content/test/dwrite_font_fake_sender_win.h" |
| 59 #endif |
| 60 |
56 using blink::WebGestureEvent; | 61 using blink::WebGestureEvent; |
57 using blink::WebInputEvent; | 62 using blink::WebInputEvent; |
58 using blink::WebLocalFrame; | 63 using blink::WebLocalFrame; |
59 using blink::WebMouseEvent; | 64 using blink::WebMouseEvent; |
60 using blink::WebScriptSource; | 65 using blink::WebScriptSource; |
61 using blink::WebString; | 66 using blink::WebString; |
62 using blink::WebURLRequest; | 67 using blink::WebURLRequest; |
63 | 68 |
64 namespace { | 69 namespace { |
65 | 70 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // because it uses blink internally. | 217 // because it uses blink internally. |
213 blink::initialize(blink_platform_impl_.Get()); | 218 blink::initialize(blink_platform_impl_.Get()); |
214 | 219 |
215 content_client_.reset(CreateContentClient()); | 220 content_client_.reset(CreateContentClient()); |
216 content_browser_client_.reset(CreateContentBrowserClient()); | 221 content_browser_client_.reset(CreateContentBrowserClient()); |
217 content_renderer_client_.reset(CreateContentRendererClient()); | 222 content_renderer_client_.reset(CreateContentRendererClient()); |
218 SetContentClient(content_client_.get()); | 223 SetContentClient(content_client_.get()); |
219 SetBrowserClientForTesting(content_browser_client_.get()); | 224 SetBrowserClientForTesting(content_browser_client_.get()); |
220 SetRendererClientForTesting(content_renderer_client_.get()); | 225 SetRendererClientForTesting(content_renderer_client_.get()); |
221 | 226 |
| 227 #if defined(OS_WIN) |
| 228 // This needs to happen sometime before PlatformInitialize. |
| 229 // This isn't actually necessary for most tests: most tests are able to |
| 230 // connect to their browser process which runs the real proxy host. However, |
| 231 // some tests route IPCs to MockRenderThread, which is unable to process the |
| 232 // font IPCs, causing all font loading to fail. |
| 233 SetDWriteFontProxySenderForTesting(CreateFakeCollectionSender()); |
| 234 #endif |
| 235 |
222 // Subclasses can set render_thread_ with their own implementation before | 236 // Subclasses can set render_thread_ with their own implementation before |
223 // calling RenderViewTest::SetUp(). | 237 // calling RenderViewTest::SetUp(). |
224 if (!render_thread_) | 238 if (!render_thread_) |
225 render_thread_.reset(new MockRenderThread()); | 239 render_thread_.reset(new MockRenderThread()); |
226 render_thread_->set_routing_id(kRouteId); | 240 render_thread_->set_routing_id(kRouteId); |
227 render_thread_->set_new_window_routing_id(kNewWindowRouteId); | 241 render_thread_->set_new_window_routing_id(kNewWindowRouteId); |
228 render_thread_->set_new_window_main_frame_widget_routing_id( | 242 render_thread_->set_new_window_main_frame_widget_routing_id( |
229 kNewFrameWidgetRouteId); | 243 kNewFrameWidgetRouteId); |
230 render_thread_->set_new_frame_routing_id(kNewFrameRouteId); | 244 render_thread_->set_new_frame_routing_id(kNewFrameRouteId); |
231 | 245 |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 TestRenderFrame* frame = | 640 TestRenderFrame* frame = |
627 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 641 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
628 frame->Navigate(common_params, StartNavigationParams(), request_params); | 642 frame->Navigate(common_params, StartNavigationParams(), request_params); |
629 | 643 |
630 // The load actually happens asynchronously, so we pump messages to process | 644 // The load actually happens asynchronously, so we pump messages to process |
631 // the pending continuation. | 645 // the pending continuation. |
632 FrameLoadWaiter(frame).Wait(); | 646 FrameLoadWaiter(frame).Wait(); |
633 } | 647 } |
634 | 648 |
635 } // namespace content | 649 } // namespace content |
OLD | NEW |