| 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/view_messages.h" | 8 #include "content/common/view_messages.h" |
| 9 #include "content/public/browser/native_web_keyboard_event.h" | 9 #include "content/public/browser/native_web_keyboard_event.h" |
| 10 #include "content/public/common/renderer_preferences.h" | 10 #include "content/public/common/renderer_preferences.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 GoToOffset(-1, item); | 119 GoToOffset(-1, item); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void RenderViewTest::GoForward(const WebKit::WebHistoryItem& item) { | 122 void RenderViewTest::GoForward(const WebKit::WebHistoryItem& item) { |
| 123 GoToOffset(1, item); | 123 GoToOffset(1, item); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void RenderViewTest::SetUp() { | 126 void RenderViewTest::SetUp() { |
| 127 // Subclasses can set the ContentClient's renderer before calling | 127 // Subclasses can set the ContentClient's renderer before calling |
| 128 // RenderViewTest::SetUp(). | 128 // RenderViewTest::SetUp(). |
| 129 if (!GetContentClient()->renderer()) | 129 ContentRendererClient* old_client = |
| 130 GetContentClient()->set_renderer_for_testing(&content_renderer_client_); | 130 SetRendererClientForTesting(&content_renderer_client_); |
| 131 if (old_client) |
| 132 SetRendererClientForTesting(old_client); |
| 131 | 133 |
| 132 // Subclasses can set render_thread_ with their own implementation before | 134 // Subclasses can set render_thread_ with their own implementation before |
| 133 // calling RenderViewTest::SetUp(). | 135 // calling RenderViewTest::SetUp(). |
| 134 if (!render_thread_.get()) | 136 if (!render_thread_.get()) |
| 135 render_thread_.reset(new MockRenderThread()); | 137 render_thread_.reset(new MockRenderThread()); |
| 136 render_thread_->set_routing_id(kRouteId); | 138 render_thread_->set_routing_id(kRouteId); |
| 137 render_thread_->set_surface_id(kSurfaceId); | 139 render_thread_->set_surface_id(kSurfaceId); |
| 138 render_thread_->set_new_window_routing_id(kNewWindowRouteId); | 140 render_thread_->set_new_window_routing_id(kNewWindowRouteId); |
| 139 | 141 |
| 140 command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM)); | 142 command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM)); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 360 |
| 359 ViewMsg_Navigate navigate_message(impl->GetRoutingID(), navigate_params); | 361 ViewMsg_Navigate navigate_message(impl->GetRoutingID(), navigate_params); |
| 360 OnMessageReceived(navigate_message); | 362 OnMessageReceived(navigate_message); |
| 361 | 363 |
| 362 // The load actually happens asynchronously, so we pump messages to process | 364 // The load actually happens asynchronously, so we pump messages to process |
| 363 // the pending continuation. | 365 // the pending continuation. |
| 364 ProcessPendingMessages(); | 366 ProcessPendingMessages(); |
| 365 } | 367 } |
| 366 | 368 |
| 367 } // namespace content | 369 } // namespace content |
| OLD | NEW |