Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: content/public/test/render_view_test.cc

Issue 801973002: Introduce CompositorDependencies for RenderWidgetCompositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compdep: . Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/public/test/render_view_test.h ('k') | content/renderer/gpu/compositor_dependencies.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "content/common/view_messages.h" 11 #include "content/common/view_messages.h"
12 #include "content/public/browser/content_browser_client.h" 12 #include "content/public/browser/content_browser_client.h"
13 #include "content/public/browser/native_web_keyboard_event.h" 13 #include "content/public/browser/native_web_keyboard_event.h"
14 #include "content/public/common/content_client.h" 14 #include "content/public/common/content_client.h"
15 #include "content/public/common/renderer_preferences.h" 15 #include "content/public/common/renderer_preferences.h"
16 #include "content/public/renderer/content_renderer_client.h" 16 #include "content/public/renderer/content_renderer_client.h"
17 #include "content/public/test/frame_load_waiter.h" 17 #include "content/public/test/frame_load_waiter.h"
18 #include "content/renderer/history_controller.h" 18 #include "content/renderer/history_controller.h"
19 #include "content/renderer/history_serialization.h" 19 #include "content/renderer/history_serialization.h"
20 #include "content/renderer/render_thread_impl.h" 20 #include "content/renderer/render_thread_impl.h"
21 #include "content/renderer/render_view_impl.h" 21 #include "content/renderer/render_view_impl.h"
22 #include "content/renderer/renderer_blink_platform_impl.h" 22 #include "content/renderer/renderer_blink_platform_impl.h"
23 #include "content/renderer/renderer_main_platform_delegate.h" 23 #include "content/renderer/renderer_main_platform_delegate.h"
24 #include "content/renderer/scheduler/renderer_scheduler.h" 24 #include "content/renderer/scheduler/renderer_scheduler.h"
25 #include "content/test/fake_compositor_dependencies.h"
25 #include "content/test/mock_render_process.h" 26 #include "content/test/mock_render_process.h"
26 #include "content/test/test_content_client.h" 27 #include "content/test/test_content_client.h"
27 #include "third_party/WebKit/public/platform/WebScreenInfo.h" 28 #include "third_party/WebKit/public/platform/WebScreenInfo.h"
28 #include "third_party/WebKit/public/platform/WebURLRequest.h" 29 #include "third_party/WebKit/public/platform/WebURLRequest.h"
29 #include "third_party/WebKit/public/web/WebHistoryItem.h" 30 #include "third_party/WebKit/public/web/WebHistoryItem.h"
30 #include "third_party/WebKit/public/web/WebInputEvent.h" 31 #include "third_party/WebKit/public/web/WebInputEvent.h"
31 #include "third_party/WebKit/public/web/WebKit.h" 32 #include "third_party/WebKit/public/web/WebKit.h"
32 #include "third_party/WebKit/public/web/WebLocalFrame.h" 33 #include "third_party/WebKit/public/web/WebLocalFrame.h"
33 #include "third_party/WebKit/public/web/WebScriptSource.h" 34 #include "third_party/WebKit/public/web/WebScriptSource.h"
34 #include "third_party/WebKit/public/web/WebView.h" 35 #include "third_party/WebKit/public/web/WebView.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 RenderThreadImpl::RegisterSchemes(); 179 RenderThreadImpl::RegisterSchemes();
179 180
180 // This check is needed because when run under content_browsertests, 181 // This check is needed because when run under content_browsertests,
181 // ResourceBundle isn't initialized (since we have to use a diferent test 182 // ResourceBundle isn't initialized (since we have to use a diferent test
182 // suite implementation than for content_unittests). For browser_tests, this 183 // suite implementation than for content_unittests). For browser_tests, this
183 // is already initialized. 184 // is already initialized.
184 if (!ui::ResourceBundle::HasSharedInstance()) 185 if (!ui::ResourceBundle::HasSharedInstance())
185 ui::ResourceBundle::InitSharedInstanceWithLocale( 186 ui::ResourceBundle::InitSharedInstanceWithLocale(
186 "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); 187 "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
187 188
189 compositor_deps_.reset(new FakeCompositorDependencies);
188 mock_process_.reset(new MockRenderProcess); 190 mock_process_.reset(new MockRenderProcess);
189 191
190 ViewMsg_New_Params view_params; 192 ViewMsg_New_Params view_params;
191 view_params.opener_route_id = kOpenerId; 193 view_params.opener_route_id = kOpenerId;
192 view_params.window_was_created_with_opener = false; 194 view_params.window_was_created_with_opener = false;
193 view_params.renderer_preferences = RendererPreferences(); 195 view_params.renderer_preferences = RendererPreferences();
194 view_params.web_preferences = WebPreferences(); 196 view_params.web_preferences = WebPreferences();
195 view_params.view_id = kRouteId; 197 view_params.view_id = kRouteId;
196 view_params.main_frame_routing_id = kMainFrameRouteId; 198 view_params.main_frame_routing_id = kMainFrameRouteId;
197 view_params.surface_id = kSurfaceId; 199 view_params.surface_id = kSurfaceId;
198 view_params.session_storage_namespace_id = kInvalidSessionStorageNamespaceId; 200 view_params.session_storage_namespace_id = kInvalidSessionStorageNamespaceId;
199 view_params.frame_name = base::string16(); 201 view_params.frame_name = base::string16();
200 view_params.swapped_out = false; 202 view_params.swapped_out = false;
201 view_params.replicated_frame_state = FrameReplicationState(); 203 view_params.replicated_frame_state = FrameReplicationState();
202 view_params.proxy_routing_id = MSG_ROUTING_NONE; 204 view_params.proxy_routing_id = MSG_ROUTING_NONE;
203 view_params.hidden = false; 205 view_params.hidden = false;
204 view_params.never_visible = false; 206 view_params.never_visible = false;
205 view_params.next_page_id = 1; 207 view_params.next_page_id = 1;
206 view_params.initial_size = *InitialSizeParams(); 208 view_params.initial_size = *InitialSizeParams();
207 view_params.enable_auto_resize = false; 209 view_params.enable_auto_resize = false;
208 view_params.min_size = gfx::Size(); 210 view_params.min_size = gfx::Size();
209 view_params.max_size = gfx::Size(); 211 view_params.max_size = gfx::Size();
210 212
211 // This needs to pass the mock render thread to the view. 213 // This needs to pass the mock render thread to the view.
212 RenderViewImpl* view = RenderViewImpl::Create(view_params, false); 214 RenderViewImpl* view =
215 RenderViewImpl::Create(view_params, compositor_deps_.get(), false);
213 view->AddRef(); 216 view->AddRef();
214 view_ = view; 217 view_ = view;
215 } 218 }
216 219
217 void RenderViewTest::TearDown() { 220 void RenderViewTest::TearDown() {
218 // Try very hard to collect garbage before shutting down. 221 // Try very hard to collect garbage before shutting down.
219 // "5" was chosen following http://crbug.com/46571#c9 222 // "5" was chosen following http://crbug.com/46571#c9
220 const int kGCIterations = 5; 223 const int kGCIterations = 5;
221 for (int i = 0; i < kGCIterations; i++) 224 for (int i = 0; i < kGCIterations; i++)
222 GetMainFrame()->collectGarbage(); 225 GetMainFrame()->collectGarbage();
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 FrameMsg_Navigate navigate_message(impl->GetMainRenderFrame()->GetRoutingID(), 433 FrameMsg_Navigate navigate_message(impl->GetMainRenderFrame()->GetRoutingID(),
431 navigate_params); 434 navigate_params);
432 impl->GetMainRenderFrame()->OnMessageReceived(navigate_message); 435 impl->GetMainRenderFrame()->OnMessageReceived(navigate_message);
433 436
434 // The load actually happens asynchronously, so we pump messages to process 437 // The load actually happens asynchronously, so we pump messages to process
435 // the pending continuation. 438 // the pending continuation.
436 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); 439 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait();
437 } 440 }
438 441
439 } // namespace content 442 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/render_view_test.h ('k') | content/renderer/gpu/compositor_dependencies.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698