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

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

Issue 554743009: remove main_render_frame(), use GetMainRenderFrame() instead (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 6 years, 3 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
« no previous file with comments | « no previous file | content/renderer/accessibility/renderer_accessibility_browsertest.cc » ('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"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 impl->history_list_offset_ = -1; 333 impl->history_list_offset_ = -1;
334 impl->history_list_length_ = 0; 334 impl->history_list_length_ = 0;
335 impl->history_page_ids_.clear(); 335 impl->history_page_ids_.clear();
336 } 336 }
337 337
338 void RenderViewTest::Reload(const GURL& url) { 338 void RenderViewTest::Reload(const GURL& url) {
339 FrameMsg_Navigate_Params params; 339 FrameMsg_Navigate_Params params;
340 params.url = url; 340 params.url = url;
341 params.navigation_type = FrameMsg_Navigate_Type::RELOAD; 341 params.navigation_type = FrameMsg_Navigate_Type::RELOAD;
342 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 342 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
343 impl->main_render_frame()->OnNavigate(params); 343 impl->GetMainRenderFrame()->OnNavigate(params);
344 FrameLoadWaiter(impl->main_render_frame()).Wait(); 344 FrameLoadWaiter(impl->GetMainRenderFrame()).Wait();
345 } 345 }
346 346
347 uint32 RenderViewTest::GetNavigationIPCType() { 347 uint32 RenderViewTest::GetNavigationIPCType() {
348 return FrameHostMsg_DidCommitProvisionalLoad::ID; 348 return FrameHostMsg_DidCommitProvisionalLoad::ID;
349 } 349 }
350 350
351 void RenderViewTest::Resize(gfx::Size new_size, 351 void RenderViewTest::Resize(gfx::Size new_size,
352 gfx::Rect resizer_rect, 352 gfx::Rect resizer_rect,
353 bool is_fullscreen) { 353 bool is_fullscreen) {
354 ViewMsg_Resize_Params params; 354 ViewMsg_Resize_Params params;
(...skipping 10 matching lines...) Expand all
365 bool RenderViewTest::OnMessageReceived(const IPC::Message& msg) { 365 bool RenderViewTest::OnMessageReceived(const IPC::Message& msg) {
366 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 366 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
367 return impl->OnMessageReceived(msg); 367 return impl->OnMessageReceived(msg);
368 } 368 }
369 369
370 void RenderViewTest::DidNavigateWithinPage(blink::WebLocalFrame* frame, 370 void RenderViewTest::DidNavigateWithinPage(blink::WebLocalFrame* frame,
371 bool is_new_navigation) { 371 bool is_new_navigation) {
372 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 372 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
373 blink::WebHistoryItem item; 373 blink::WebHistoryItem item;
374 item.initialize(); 374 item.initialize();
375 impl->main_render_frame()->didNavigateWithinPage( 375 impl->GetMainRenderFrame()->didNavigateWithinPage(
376 frame, 376 frame,
377 item, 377 item,
378 is_new_navigation ? blink::WebStandardCommit 378 is_new_navigation ? blink::WebStandardCommit
379 : blink::WebHistoryInertCommit); 379 : blink::WebHistoryInertCommit);
380 } 380 }
381 381
382 void RenderViewTest::SendContentStateImmediately() { 382 void RenderViewTest::SendContentStateImmediately() {
383 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 383 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
384 impl->set_send_content_state_immediately(true); 384 impl->set_send_content_state_immediately(true);
385 } 385 }
(...skipping 26 matching lines...) Expand all
412 FrameMsg_Navigate_Params navigate_params; 412 FrameMsg_Navigate_Params navigate_params;
413 navigate_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; 413 navigate_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
414 navigate_params.transition = PAGE_TRANSITION_FORWARD_BACK; 414 navigate_params.transition = PAGE_TRANSITION_FORWARD_BACK;
415 navigate_params.current_history_list_length = history_list_length; 415 navigate_params.current_history_list_length = history_list_length;
416 navigate_params.current_history_list_offset = impl->history_list_offset(); 416 navigate_params.current_history_list_offset = impl->history_list_offset();
417 navigate_params.pending_history_list_offset = pending_offset; 417 navigate_params.pending_history_list_offset = pending_offset;
418 navigate_params.page_id = impl->page_id_ + offset; 418 navigate_params.page_id = impl->page_id_ + offset;
419 navigate_params.page_state = state; 419 navigate_params.page_state = state;
420 navigate_params.request_time = base::Time::Now(); 420 navigate_params.request_time = base::Time::Now();
421 421
422 FrameMsg_Navigate navigate_message(impl->main_render_frame()->GetRoutingID(), 422 FrameMsg_Navigate navigate_message(impl->GetMainRenderFrame()->GetRoutingID(),
423 navigate_params); 423 navigate_params);
424 impl->main_render_frame()->OnMessageReceived(navigate_message); 424 impl->GetMainRenderFrame()->OnMessageReceived(navigate_message);
425 425
426 // The load actually happens asynchronously, so we pump messages to process 426 // The load actually happens asynchronously, so we pump messages to process
427 // the pending continuation. 427 // the pending continuation.
428 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); 428 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait();
429 } 429 }
430 430
431 } // namespace content 431 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/accessibility/renderer_accessibility_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698