| 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/input_messages.h" | 9 #include "content/common/input_messages.h" |
| 10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 using blink::WebScriptController; | 34 using blink::WebScriptController; |
| 35 using blink::WebScriptSource; | 35 using blink::WebScriptSource; |
| 36 using blink::WebString; | 36 using blink::WebString; |
| 37 using blink::WebURLRequest; | 37 using blink::WebURLRequest; |
| 38 | 38 |
| 39 namespace { | 39 namespace { |
| 40 const int32 kOpenerId = -2; | 40 const int32 kOpenerId = -2; |
| 41 const int32 kRouteId = 5; | 41 const int32 kRouteId = 5; |
| 42 const int32 kMainFrameRouteId = 6; | 42 const int32 kMainFrameRouteId = 6; |
| 43 const int32 kNewWindowRouteId = 7; | 43 const int32 kNewWindowRouteId = 7; |
| 44 const int32 kNewFrameRouteId = 10; |
| 44 const int32 kSurfaceId = 42; | 45 const int32 kSurfaceId = 42; |
| 45 | 46 |
| 46 } // namespace | 47 } // namespace |
| 47 | 48 |
| 48 namespace content { | 49 namespace content { |
| 49 | 50 |
| 50 class RendererWebKitPlatformSupportImplNoSandboxImpl | 51 class RendererWebKitPlatformSupportImplNoSandboxImpl |
| 51 : public RendererWebKitPlatformSupportImpl { | 52 : public RendererWebKitPlatformSupportImpl { |
| 52 public: | 53 public: |
| 53 virtual blink::WebSandboxSupport* sandboxSupport() { | 54 virtual blink::WebSandboxSupport* sandboxSupport() { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 if (old_client) | 134 if (old_client) |
| 134 SetRendererClientForTesting(old_client); | 135 SetRendererClientForTesting(old_client); |
| 135 | 136 |
| 136 // Subclasses can set render_thread_ with their own implementation before | 137 // Subclasses can set render_thread_ with their own implementation before |
| 137 // calling RenderViewTest::SetUp(). | 138 // calling RenderViewTest::SetUp(). |
| 138 if (!render_thread_) | 139 if (!render_thread_) |
| 139 render_thread_.reset(new MockRenderThread()); | 140 render_thread_.reset(new MockRenderThread()); |
| 140 render_thread_->set_routing_id(kRouteId); | 141 render_thread_->set_routing_id(kRouteId); |
| 141 render_thread_->set_surface_id(kSurfaceId); | 142 render_thread_->set_surface_id(kSurfaceId); |
| 142 render_thread_->set_new_window_routing_id(kNewWindowRouteId); | 143 render_thread_->set_new_window_routing_id(kNewWindowRouteId); |
| 144 render_thread_->set_new_frame_routing_id(kNewFrameRouteId); |
| 143 | 145 |
| 144 command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM)); | 146 command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM)); |
| 145 params_.reset(new MainFunctionParams(*command_line_)); | 147 params_.reset(new MainFunctionParams(*command_line_)); |
| 146 platform_.reset(new RendererMainPlatformDelegate(*params_)); | 148 platform_.reset(new RendererMainPlatformDelegate(*params_)); |
| 147 platform_->PlatformInitialize(); | 149 platform_->PlatformInitialize(); |
| 148 | 150 |
| 149 // Setting flags and really doing anything with WebKit is fairly fragile and | 151 // Setting flags and really doing anything with WebKit is fairly fragile and |
| 150 // hacky, but this is the world we live in... | 152 // hacky, but this is the world we live in... |
| 151 webkit_glue::SetJavaScriptFlags(" --expose-gc"); | 153 webkit_glue::SetJavaScriptFlags(" --expose-gc"); |
| 152 blink::initialize(webkit_platform_support_.Get()); | 154 blink::initialize(webkit_platform_support_.Get()); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 | 378 |
| 377 ViewMsg_Navigate navigate_message(impl->GetRoutingID(), navigate_params); | 379 ViewMsg_Navigate navigate_message(impl->GetRoutingID(), navigate_params); |
| 378 OnMessageReceived(navigate_message); | 380 OnMessageReceived(navigate_message); |
| 379 | 381 |
| 380 // The load actually happens asynchronously, so we pump messages to process | 382 // The load actually happens asynchronously, so we pump messages to process |
| 381 // the pending continuation. | 383 // the pending continuation. |
| 382 ProcessPendingMessages(); | 384 ProcessPendingMessages(); |
| 383 } | 385 } |
| 384 | 386 |
| 385 } // namespace content | 387 } // namespace content |
| OLD | NEW |