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

Side by Side Diff: content/test/test_render_view_host.cc

Issue 1151973005: Bring RFH/RVH unit tests closer to reality of how RF/RV are initialized (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix IsRenderFrameLive to be independent of RenderViewHost. Created 5 years, 7 months 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
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/test/test_render_view_host.h" 5 #include "content/test/test_render_view_host.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" 8 #include "content/browser/dom_storage/dom_storage_context_wrapper.h"
9 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 9 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
10 #include "content/browser/loader/resource_dispatcher_host_impl.h" 10 #include "content/browser/loader/resource_dispatcher_host_impl.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 bool TestRenderViewHost::CreateRenderView( 239 bool TestRenderViewHost::CreateRenderView(
240 const base::string16& frame_name, 240 const base::string16& frame_name,
241 int opener_route_id, 241 int opener_route_id,
242 int proxy_route_id, 242 int proxy_route_id,
243 int32 max_page_id, 243 int32 max_page_id,
244 bool window_was_created_with_opener) { 244 bool window_was_created_with_opener) {
245 DCHECK(!IsRenderViewLive()); 245 DCHECK(!IsRenderViewLive());
246 set_renderer_initialized(true); 246 set_renderer_initialized(true);
247 DCHECK(IsRenderViewLive()); 247 DCHECK(IsRenderViewLive());
248 opener_route_id_ = opener_route_id; 248 opener_route_id_ = opener_route_id;
249 RenderFrameHost* main_frame = GetMainFrame();
250 if (main_frame)
ncarter (slow) 2015/05/26 21:44:14 When is this null? In RenderViewHostImpl's CreateR
nasko 2015/05/26 22:25:49 This is in preparation for removing swapped out. W
251 static_cast<RenderFrameHostImpl*>(main_frame)->SetRenderFrameCreated(true);
252
249 return true; 253 return true;
250 } 254 }
251 255
252 bool TestRenderViewHost::IsFullscreenGranted() const { 256 bool TestRenderViewHost::IsFullscreenGranted() const {
253 return RenderViewHostImpl::IsFullscreenGranted(); 257 return RenderViewHostImpl::IsFullscreenGranted();
254 } 258 }
255 259
256 MockRenderProcessHost* TestRenderViewHost::GetProcess() const { 260 MockRenderProcessHost* TestRenderViewHost::GetProcess() const {
257 return static_cast<MockRenderProcessHost*>(RenderViewHostImpl::GetProcess()); 261 return static_cast<MockRenderProcessHost*>(RenderViewHostImpl::GetProcess());
258 } 262 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 317
314 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { 318 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() {
315 return contents()->GetMainFrame(); 319 return contents()->GetMainFrame();
316 } 320 }
317 321
318 TestWebContents* RenderViewHostImplTestHarness::contents() { 322 TestWebContents* RenderViewHostImplTestHarness::contents() {
319 return static_cast<TestWebContents*>(web_contents()); 323 return static_cast<TestWebContents*>(web_contents());
320 } 324 }
321 325
322 } // namespace content 326 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698