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 <cctype> | 7 #include <cctype> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "third_party/WebKit/public/web/WebScriptSource.h" | 42 #include "third_party/WebKit/public/web/WebScriptSource.h" |
43 #include "third_party/WebKit/public/web/WebView.h" | 43 #include "third_party/WebKit/public/web/WebView.h" |
44 #include "ui/base/resource/resource_bundle.h" | 44 #include "ui/base/resource/resource_bundle.h" |
45 #include "ui/events/keycodes/keyboard_codes.h" | 45 #include "ui/events/keycodes/keyboard_codes.h" |
46 #include "v8/include/v8.h" | 46 #include "v8/include/v8.h" |
47 | 47 |
48 #if defined(OS_MACOSX) | 48 #if defined(OS_MACOSX) |
49 #include "base/mac/scoped_nsautorelease_pool.h" | 49 #include "base/mac/scoped_nsautorelease_pool.h" |
50 #endif | 50 #endif |
51 | 51 |
| 52 #if defined(OS_WIN) |
| 53 #include "content/common/dwrite_font_proxy_init_win.h" |
| 54 #include "content/test/dwrite_font_fake_sender_win.h" |
| 55 #endif |
| 56 |
52 using blink::WebGestureEvent; | 57 using blink::WebGestureEvent; |
53 using blink::WebInputEvent; | 58 using blink::WebInputEvent; |
54 using blink::WebLocalFrame; | 59 using blink::WebLocalFrame; |
55 using blink::WebMouseEvent; | 60 using blink::WebMouseEvent; |
56 using blink::WebScriptSource; | 61 using blink::WebScriptSource; |
57 using blink::WebString; | 62 using blink::WebString; |
58 using blink::WebURLRequest; | 63 using blink::WebURLRequest; |
59 | 64 |
60 namespace { | 65 namespace { |
61 | 66 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // because it uses blink internally. | 202 // because it uses blink internally. |
198 blink::initialize(blink_platform_impl_.Get()); | 203 blink::initialize(blink_platform_impl_.Get()); |
199 | 204 |
200 content_client_.reset(CreateContentClient()); | 205 content_client_.reset(CreateContentClient()); |
201 content_browser_client_.reset(CreateContentBrowserClient()); | 206 content_browser_client_.reset(CreateContentBrowserClient()); |
202 content_renderer_client_.reset(CreateContentRendererClient()); | 207 content_renderer_client_.reset(CreateContentRendererClient()); |
203 SetContentClient(content_client_.get()); | 208 SetContentClient(content_client_.get()); |
204 SetBrowserClientForTesting(content_browser_client_.get()); | 209 SetBrowserClientForTesting(content_browser_client_.get()); |
205 SetRendererClientForTesting(content_renderer_client_.get()); | 210 SetRendererClientForTesting(content_renderer_client_.get()); |
206 | 211 |
| 212 #if defined(OS_WIN) |
| 213 // This needs to happen sometime before PlatformInitialize. |
| 214 // This isn't actually necessary for most tests: most tests are able to |
| 215 // connect to their browser process which runs the real proxy host. However, |
| 216 // some tests route IPCs to MockRenderThread, which is unable to process the |
| 217 // font IPCs, causing all font loading to fail. |
| 218 SetDWriteFontProxyTestModeSender(CreateFakeCollectionSender()); |
| 219 #endif |
| 220 |
207 // Subclasses can set render_thread_ with their own implementation before | 221 // Subclasses can set render_thread_ with their own implementation before |
208 // calling RenderViewTest::SetUp(). | 222 // calling RenderViewTest::SetUp(). |
209 if (!render_thread_) | 223 if (!render_thread_) |
210 render_thread_.reset(new MockRenderThread()); | 224 render_thread_.reset(new MockRenderThread()); |
211 render_thread_->set_routing_id(kRouteId); | 225 render_thread_->set_routing_id(kRouteId); |
212 render_thread_->set_new_window_routing_id(kNewWindowRouteId); | 226 render_thread_->set_new_window_routing_id(kNewWindowRouteId); |
213 render_thread_->set_new_window_main_frame_widget_routing_id( | 227 render_thread_->set_new_window_main_frame_widget_routing_id( |
214 kNewFrameWidgetRouteId); | 228 kNewFrameWidgetRouteId); |
215 render_thread_->set_new_frame_routing_id(kNewFrameRouteId); | 229 render_thread_->set_new_frame_routing_id(kNewFrameRouteId); |
216 | 230 |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 TestRenderFrame* frame = | 614 TestRenderFrame* frame = |
601 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 615 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
602 frame->Navigate(common_params, StartNavigationParams(), request_params); | 616 frame->Navigate(common_params, StartNavigationParams(), request_params); |
603 | 617 |
604 // The load actually happens asynchronously, so we pump messages to process | 618 // The load actually happens asynchronously, so we pump messages to process |
605 // the pending continuation. | 619 // the pending continuation. |
606 FrameLoadWaiter(frame).Wait(); | 620 FrameLoadWaiter(frame).Wait(); |
607 } | 621 } |
608 | 622 |
609 } // namespace content | 623 } // namespace content |
OLD | NEW |