| 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 "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "content/common/dom_storage/dom_storage_types.h" | 8 #include "content/common/dom_storage/dom_storage_types.h" |
| 9 #include "content/common/frame_messages.h" | 9 #include "content/common/frame_messages.h" |
| 10 #include "content/common/input_messages.h" | 10 #include "content/common/input_messages.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 31 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 32 #include "third_party/WebKit/public/web/WebScriptSource.h" | 32 #include "third_party/WebKit/public/web/WebScriptSource.h" |
| 33 #include "third_party/WebKit/public/web/WebView.h" | 33 #include "third_party/WebKit/public/web/WebView.h" |
| 34 #include "ui/base/resource/resource_bundle.h" | 34 #include "ui/base/resource/resource_bundle.h" |
| 35 #include "v8/include/v8.h" | 35 #include "v8/include/v8.h" |
| 36 | 36 |
| 37 #if defined(OS_MACOSX) | 37 #if defined(OS_MACOSX) |
| 38 #include "base/mac/scoped_nsautorelease_pool.h" | 38 #include "base/mac/scoped_nsautorelease_pool.h" |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 42 #include "gin/public/isolate_holder.h" |
| 43 #endif |
| 44 |
| 41 using blink::WebInputEvent; | 45 using blink::WebInputEvent; |
| 42 using blink::WebLocalFrame; | 46 using blink::WebLocalFrame; |
| 43 using blink::WebMouseEvent; | 47 using blink::WebMouseEvent; |
| 44 using blink::WebScriptSource; | 48 using blink::WebScriptSource; |
| 45 using blink::WebString; | 49 using blink::WebString; |
| 46 using blink::WebURLRequest; | 50 using blink::WebURLRequest; |
| 47 | 51 |
| 48 namespace { | 52 namespace { |
| 49 const int32 kOpenerId = -2; | 53 const int32 kOpenerId = -2; |
| 50 const int32 kRouteId = 5; | 54 const int32 kRouteId = 5; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 #endif | 162 #endif |
| 159 command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM)); | 163 command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM)); |
| 160 params_.reset(new MainFunctionParams(*command_line_)); | 164 params_.reset(new MainFunctionParams(*command_line_)); |
| 161 platform_.reset(new RendererMainPlatformDelegate(*params_)); | 165 platform_.reset(new RendererMainPlatformDelegate(*params_)); |
| 162 platform_->PlatformInitialize(); | 166 platform_->PlatformInitialize(); |
| 163 | 167 |
| 164 // Setting flags and really doing anything with WebKit is fairly fragile and | 168 // Setting flags and really doing anything with WebKit is fairly fragile and |
| 165 // hacky, but this is the world we live in... | 169 // hacky, but this is the world we live in... |
| 166 std::string flags("--expose-gc"); | 170 std::string flags("--expose-gc"); |
| 167 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); | 171 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); |
| 172 |
| 173 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 174 gin::IsolateHolder::LoadV8Snapshot(); |
| 175 #endif |
| 176 |
| 168 blink::initialize(blink_platform_impl_.Get()); | 177 blink::initialize(blink_platform_impl_.Get()); |
| 169 | 178 |
| 170 // Ensure that we register any necessary schemes when initializing WebKit, | 179 // Ensure that we register any necessary schemes when initializing WebKit, |
| 171 // since we are using a MockRenderThread. | 180 // since we are using a MockRenderThread. |
| 172 RenderThreadImpl::RegisterSchemes(); | 181 RenderThreadImpl::RegisterSchemes(); |
| 173 | 182 |
| 174 // This check is needed because when run under content_browsertests, | 183 // This check is needed because when run under content_browsertests, |
| 175 // ResourceBundle isn't initialized (since we have to use a diferent test | 184 // ResourceBundle isn't initialized (since we have to use a diferent test |
| 176 // suite implementation than for content_unittests). For browser_tests, this | 185 // suite implementation than for content_unittests). For browser_tests, this |
| 177 // is already initialized. | 186 // is already initialized. |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 FrameMsg_Navigate navigate_message(impl->GetMainRenderFrame()->GetRoutingID(), | 431 FrameMsg_Navigate navigate_message(impl->GetMainRenderFrame()->GetRoutingID(), |
| 423 navigate_params); | 432 navigate_params); |
| 424 impl->GetMainRenderFrame()->OnMessageReceived(navigate_message); | 433 impl->GetMainRenderFrame()->OnMessageReceived(navigate_message); |
| 425 | 434 |
| 426 // The load actually happens asynchronously, so we pump messages to process | 435 // The load actually happens asynchronously, so we pump messages to process |
| 427 // the pending continuation. | 436 // the pending continuation. |
| 428 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); | 437 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); |
| 429 } | 438 } |
| 430 | 439 |
| 431 } // namespace content | 440 } // namespace content |
| OLD | NEW |