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

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

Issue 1678303004: PlzNavigate: inform the renderer that a navigation is a POST (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 10 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/public/test/render_view_test.h" 5 #include "content/public/test/render_view_test.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cctype> 9 #include <cctype>
10 10
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 void RenderViewTest::SetFocused(const blink::WebNode& node) { 563 void RenderViewTest::SetFocused(const blink::WebNode& node) {
564 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 564 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
565 impl->focusedNodeChanged(blink::WebNode(), node); 565 impl->focusedNodeChanged(blink::WebNode(), node);
566 } 566 }
567 567
568 void RenderViewTest::Reload(const GURL& url) { 568 void RenderViewTest::Reload(const GURL& url) {
569 CommonNavigationParams common_params( 569 CommonNavigationParams common_params(
570 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD, 570 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD,
571 true, false, base::TimeTicks(), 571 true, false, base::TimeTicks(),
572 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), 572 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(),
573 LOFI_UNSPECIFIED, base::TimeTicks::Now()); 573 LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET");
574 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 574 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
575 TestRenderFrame* frame = 575 TestRenderFrame* frame =
576 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 576 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
577 frame->Navigate(common_params, StartNavigationParams(), 577 frame->Navigate(common_params, StartNavigationParams(),
578 RequestNavigationParams()); 578 RequestNavigationParams());
579 FrameLoadWaiter(frame).Wait(); 579 FrameLoadWaiter(frame).Wait();
580 } 580 }
581 581
582 uint32_t RenderViewTest::GetNavigationIPCType() { 582 uint32_t RenderViewTest::GetNavigationIPCType() {
583 return FrameHostMsg_DidCommitProvisionalLoad::ID; 583 return FrameHostMsg_DidCommitProvisionalLoad::ID;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 696 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
697 697
698 int history_list_length = impl->historyBackListCount() + 698 int history_list_length = impl->historyBackListCount() +
699 impl->historyForwardListCount() + 1; 699 impl->historyForwardListCount() + 1;
700 int pending_offset = offset + impl->history_list_offset_; 700 int pending_offset = offset + impl->history_list_offset_;
701 701
702 CommonNavigationParams common_params( 702 CommonNavigationParams common_params(
703 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, 703 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK,
704 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(), 704 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(),
705 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), 705 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(),
706 LOFI_UNSPECIFIED, base::TimeTicks::Now()); 706 LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET");
707 RequestNavigationParams request_params; 707 RequestNavigationParams request_params;
708 request_params.page_state = state; 708 request_params.page_state = state;
709 request_params.page_id = impl->page_id_ + offset; 709 request_params.page_id = impl->page_id_ + offset;
710 request_params.nav_entry_id = pending_offset + 1; 710 request_params.nav_entry_id = pending_offset + 1;
711 request_params.pending_history_list_offset = pending_offset; 711 request_params.pending_history_list_offset = pending_offset;
712 request_params.current_history_list_offset = impl->history_list_offset_; 712 request_params.current_history_list_offset = impl->history_list_offset_;
713 request_params.current_history_list_length = history_list_length; 713 request_params.current_history_list_length = history_list_length;
714 714
715 TestRenderFrame* frame = 715 TestRenderFrame* frame =
716 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 716 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
717 frame->Navigate(common_params, StartNavigationParams(), request_params); 717 frame->Navigate(common_params, StartNavigationParams(), request_params);
718 718
719 // The load actually happens asynchronously, so we pump messages to process 719 // The load actually happens asynchronously, so we pump messages to process
720 // the pending continuation. 720 // the pending continuation.
721 FrameLoadWaiter(frame).Wait(); 721 FrameLoadWaiter(frame).Wait();
722 } 722 }
723 723
724 } // namespace content 724 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698