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

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

Issue 1310743003: Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bengr comments and rebase Created 5 years, 1 month 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/renderer/render_frame.h ('k') | content/renderer/render_frame_impl.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 <cctype> 7 #include <cctype>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 439
440 void RenderViewTest::SetFocused(const blink::WebNode& node) { 440 void RenderViewTest::SetFocused(const blink::WebNode& node) {
441 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 441 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
442 impl->focusedNodeChanged(blink::WebNode(), node); 442 impl->focusedNodeChanged(blink::WebNode(), node);
443 } 443 }
444 444
445 void RenderViewTest::Reload(const GURL& url) { 445 void RenderViewTest::Reload(const GURL& url) {
446 CommonNavigationParams common_params( 446 CommonNavigationParams common_params(
447 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD, 447 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD,
448 true, false, base::TimeTicks(), 448 true, false, base::TimeTicks(),
449 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL()); 449 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(),
450 LOFI_UNSPECIFIED);
450 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 451 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
451 TestRenderFrame* frame = 452 TestRenderFrame* frame =
452 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 453 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
453 frame->Navigate(common_params, StartNavigationParams(), 454 frame->Navigate(common_params, StartNavigationParams(),
454 RequestNavigationParams()); 455 RequestNavigationParams());
455 FrameLoadWaiter(frame).Wait(); 456 FrameLoadWaiter(frame).Wait();
456 } 457 }
457 458
458 uint32 RenderViewTest::GetNavigationIPCType() { 459 uint32 RenderViewTest::GetNavigationIPCType() {
459 return FrameHostMsg_DidCommitProvisionalLoad::ID; 460 return FrameHostMsg_DidCommitProvisionalLoad::ID;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 void RenderViewTest::GoToOffset(int offset, const PageState& state) { 572 void RenderViewTest::GoToOffset(int offset, const PageState& state) {
572 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 573 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
573 574
574 int history_list_length = impl->historyBackListCount() + 575 int history_list_length = impl->historyBackListCount() +
575 impl->historyForwardListCount() + 1; 576 impl->historyForwardListCount() + 1;
576 int pending_offset = offset + impl->history_list_offset_; 577 int pending_offset = offset + impl->history_list_offset_;
577 578
578 CommonNavigationParams common_params( 579 CommonNavigationParams common_params(
579 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, 580 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK,
580 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(), 581 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(),
581 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL()); 582 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(),
583 LOFI_UNSPECIFIED);
582 RequestNavigationParams request_params; 584 RequestNavigationParams request_params;
583 request_params.page_state = state; 585 request_params.page_state = state;
584 request_params.page_id = impl->page_id_ + offset; 586 request_params.page_id = impl->page_id_ + offset;
585 request_params.nav_entry_id = pending_offset + 1; 587 request_params.nav_entry_id = pending_offset + 1;
586 request_params.pending_history_list_offset = pending_offset; 588 request_params.pending_history_list_offset = pending_offset;
587 request_params.current_history_list_offset = impl->history_list_offset_; 589 request_params.current_history_list_offset = impl->history_list_offset_;
588 request_params.current_history_list_length = history_list_length; 590 request_params.current_history_list_length = history_list_length;
589 591
590 TestRenderFrame* frame = 592 TestRenderFrame* frame =
591 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 593 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
592 frame->Navigate(common_params, StartNavigationParams(), request_params); 594 frame->Navigate(common_params, StartNavigationParams(), request_params);
593 595
594 // The load actually happens asynchronously, so we pump messages to process 596 // The load actually happens asynchronously, so we pump messages to process
595 // the pending continuation. 597 // the pending continuation.
596 FrameLoadWaiter(frame).Wait(); 598 FrameLoadWaiter(frame).Wait();
597 } 599 }
598 600
599 } // namespace content 601 } // namespace content
OLDNEW
« no previous file with comments | « content/public/renderer/render_frame.h ('k') | content/renderer/render_frame_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698