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 "content/common/view_messages.h" | 7 #include "content/common/view_messages.h" |
8 #include "content/public/browser/native_web_keyboard_event.h" | 8 #include "content/public/browser/native_web_keyboard_event.h" |
9 #include "content/public/common/renderer_preferences.h" | 9 #include "content/public/common/renderer_preferences.h" |
10 #include "content/renderer/render_thread_impl.h" | 10 #include "content/renderer/render_thread_impl.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 // Setting flags and really doing anything with WebKit is fairly fragile and | 144 // Setting flags and really doing anything with WebKit is fairly fragile and |
145 // hacky, but this is the world we live in... | 145 // hacky, but this is the world we live in... |
146 webkit_glue::SetJavaScriptFlags(" --expose-gc"); | 146 webkit_glue::SetJavaScriptFlags(" --expose-gc"); |
147 WebKit::initialize(webkit_platform_support_.Get()); | 147 WebKit::initialize(webkit_platform_support_.Get()); |
148 | 148 |
149 // Ensure that we register any necessary schemes when initializing WebKit, | 149 // Ensure that we register any necessary schemes when initializing WebKit, |
150 // since we are using a MockRenderThread. | 150 // since we are using a MockRenderThread. |
151 RenderThreadImpl::RegisterSchemes(); | 151 RenderThreadImpl::RegisterSchemes(); |
152 | 152 |
153 //ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 153 // This check is needed because when run under content_browsertests, |
| 154 // ResourceBundle isn't initialized (since we have to use a diferent test |
| 155 // suite implementation than for content_unittests). For browser_tests, this |
| 156 // is already initialized. |
| 157 if (!ResourceBundle::HasSharedInstance()) |
| 158 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
154 | 159 |
155 mock_process_.reset(new MockRenderProcess); | 160 mock_process_.reset(new MockRenderProcess); |
156 | 161 |
157 // This needs to pass the mock render thread to the view. | 162 // This needs to pass the mock render thread to the view. |
158 RenderViewImpl* view = RenderViewImpl::Create( | 163 RenderViewImpl* view = RenderViewImpl::Create( |
159 0, | 164 0, |
160 kOpenerId, | 165 kOpenerId, |
161 content::RendererPreferences(), | 166 content::RendererPreferences(), |
162 webkit_glue::WebPreferences(), | 167 webkit_glue::WebPreferences(), |
163 new SharedRenderViewCounter(0), | 168 new SharedRenderViewCounter(0), |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 366 |
362 ViewMsg_Navigate navigate_message(impl->GetRoutingID(), navigate_params); | 367 ViewMsg_Navigate navigate_message(impl->GetRoutingID(), navigate_params); |
363 OnMessageReceived(navigate_message); | 368 OnMessageReceived(navigate_message); |
364 | 369 |
365 // The load actually happens asynchronously, so we pump messages to process | 370 // The load actually happens asynchronously, so we pump messages to process |
366 // the pending continuation. | 371 // the pending continuation. |
367 ProcessPendingMessages(); | 372 ProcessPendingMessages(); |
368 } | 373 } |
369 | 374 |
370 } // namespace content | 375 } // namespace content |
OLD | NEW |