| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 #if defined(OS_MACOSX) | 54 #if defined(OS_MACOSX) |
| 55 #include "base/mac/scoped_nsautorelease_pool.h" | 55 #include "base/mac/scoped_nsautorelease_pool.h" |
| 56 #endif | 56 #endif |
| 57 | 57 |
| 58 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
| 59 #include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h" | 59 #include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h" |
| 60 #include "content/test/dwrite_font_fake_sender_win.h" | 60 #include "content/test/dwrite_font_fake_sender_win.h" |
| 61 #endif | 61 #endif |
| 62 | 62 |
| 63 #if defined(OS_CHROMEOS) |
| 64 #include "base/path_service.h" |
| 65 #endif |
| 66 |
| 63 using blink::WebGestureEvent; | 67 using blink::WebGestureEvent; |
| 64 using blink::WebInputEvent; | 68 using blink::WebInputEvent; |
| 65 using blink::WebLocalFrame; | 69 using blink::WebLocalFrame; |
| 66 using blink::WebMouseEvent; | 70 using blink::WebMouseEvent; |
| 67 using blink::WebScriptSource; | 71 using blink::WebScriptSource; |
| 68 using blink::WebString; | 72 using blink::WebString; |
| 69 using blink::WebURLRequest; | 73 using blink::WebURLRequest; |
| 70 | 74 |
| 71 namespace { | 75 namespace { |
| 72 | 76 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); | 277 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); |
| 274 | 278 |
| 275 // Ensure that we register any necessary schemes when initializing WebKit, | 279 // Ensure that we register any necessary schemes when initializing WebKit, |
| 276 // since we are using a MockRenderThread. | 280 // since we are using a MockRenderThread. |
| 277 RenderThreadImpl::RegisterSchemes(); | 281 RenderThreadImpl::RegisterSchemes(); |
| 278 | 282 |
| 279 // This check is needed because when run under content_browsertests, | 283 // This check is needed because when run under content_browsertests, |
| 280 // ResourceBundle isn't initialized (since we have to use a diferent test | 284 // ResourceBundle isn't initialized (since we have to use a diferent test |
| 281 // suite implementation than for content_unittests). For browser_tests, this | 285 // suite implementation than for content_unittests). For browser_tests, this |
| 282 // is already initialized. | 286 // is already initialized. |
| 283 if (!ui::ResourceBundle::HasSharedInstance()) | 287 if (!ui::ResourceBundle::HasSharedInstance()) { |
| 288 #if defined(OS_CHROMEOS) |
| 289 base::FilePath pak_file; |
| 290 bool r = PathService::Get(base::DIR_MODULE, &pak_file); |
| 291 DCHECK(r); |
| 292 pak_file = pak_file.Append(FILE_PATH_LITERAL("content_shell.pak")); |
| 293 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); |
| 294 #else |
| 284 ui::ResourceBundle::InitSharedInstanceWithLocale( | 295 ui::ResourceBundle::InitSharedInstanceWithLocale( |
| 285 "en-US", NULL, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); | 296 "en-US", NULL, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); |
| 297 #endif |
| 298 } |
| 286 | 299 |
| 287 compositor_deps_.reset(new FakeCompositorDependencies); | 300 compositor_deps_.reset(new FakeCompositorDependencies); |
| 288 mock_process_.reset(new MockRenderProcess); | 301 mock_process_.reset(new MockRenderProcess); |
| 289 | 302 |
| 290 ViewMsg_New_Params view_params; | 303 ViewMsg_New_Params view_params; |
| 291 view_params.opener_frame_route_id = MSG_ROUTING_NONE; | 304 view_params.opener_frame_route_id = MSG_ROUTING_NONE; |
| 292 view_params.window_was_created_with_opener = false; | 305 view_params.window_was_created_with_opener = false; |
| 293 view_params.renderer_preferences = RendererPreferences(); | 306 view_params.renderer_preferences = RendererPreferences(); |
| 294 view_params.web_preferences = WebPreferences(); | 307 view_params.web_preferences = WebPreferences(); |
| 295 view_params.view_id = kRouteId; | 308 view_params.view_id = kRouteId; |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 674 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
| 662 frame->Navigate(common_params, StartNavigationParams(), request_params); | 675 frame->Navigate(common_params, StartNavigationParams(), request_params); |
| 663 | 676 |
| 664 // The load actually happens asynchronously, so we pump messages to process | 677 // The load actually happens asynchronously, so we pump messages to process |
| 665 // the pending continuation. | 678 // the pending continuation. |
| 666 FrameLoadWaiter(frame).Wait(); | 679 FrameLoadWaiter(frame).Wait(); |
| 667 view_->GetWebView()->updateAllLifecyclePhases(); | 680 view_->GetWebView()->updateAllLifecyclePhases(); |
| 668 } | 681 } |
| 669 | 682 |
| 670 } // namespace content | 683 } // namespace content |
| OLD | NEW |