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

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

Issue 2406053002: PlzNavigate: Fix the failing ContinueWhereILeftOffTest.PostWithPassword test. (Closed)
Patch Set: Fix test failures Created 4 years, 2 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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 void RenderViewTest::SetFocused(const blink::WebNode& node) { 505 void RenderViewTest::SetFocused(const blink::WebNode& node) {
506 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 506 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
507 impl->focusedNodeChanged(blink::WebNode(), node); 507 impl->focusedNodeChanged(blink::WebNode(), node);
508 } 508 }
509 509
510 void RenderViewTest::Reload(const GURL& url) { 510 void RenderViewTest::Reload(const GURL& url) {
511 CommonNavigationParams common_params( 511 CommonNavigationParams common_params(
512 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD, 512 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD,
513 true, false, base::TimeTicks(), 513 true, false, base::TimeTicks(),
514 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), 514 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(),
515 LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr); 515 LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET", false, nullptr);
516 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 516 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
517 TestRenderFrame* frame = 517 TestRenderFrame* frame =
518 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 518 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
519 frame->Navigate(common_params, StartNavigationParams(), 519 frame->Navigate(common_params, StartNavigationParams(),
520 RequestNavigationParams()); 520 RequestNavigationParams());
521 FrameLoadWaiter(frame).Wait(); 521 FrameLoadWaiter(frame).Wait();
522 view_->GetWebView()->updateAllLifecyclePhases(); 522 view_->GetWebView()->updateAllLifecyclePhases();
523 } 523 }
524 524
525 uint32_t RenderViewTest::GetNavigationIPCType() { 525 uint32_t RenderViewTest::GetNavigationIPCType() {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 642 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
643 643
644 int history_list_length = impl->historyBackListCount() + 644 int history_list_length = impl->historyBackListCount() +
645 impl->historyForwardListCount() + 1; 645 impl->historyForwardListCount() + 1;
646 int pending_offset = offset + impl->history_list_offset_; 646 int pending_offset = offset + impl->history_list_offset_;
647 647
648 CommonNavigationParams common_params( 648 CommonNavigationParams common_params(
649 url, Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, 649 url, Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK,
650 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(), 650 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(),
651 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), 651 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(),
652 LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr); 652 LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET", false, nullptr);
653 RequestNavigationParams request_params; 653 RequestNavigationParams request_params;
654 request_params.page_state = state; 654 request_params.page_state = state;
655 request_params.page_id = impl->page_id_ + offset; 655 request_params.page_id = impl->page_id_ + offset;
656 request_params.nav_entry_id = pending_offset + 1; 656 request_params.nav_entry_id = pending_offset + 1;
657 request_params.pending_history_list_offset = pending_offset; 657 request_params.pending_history_list_offset = pending_offset;
658 request_params.current_history_list_offset = impl->history_list_offset_; 658 request_params.current_history_list_offset = impl->history_list_offset_;
659 request_params.current_history_list_length = history_list_length; 659 request_params.current_history_list_length = history_list_length;
660 660
661 TestRenderFrame* frame = 661 TestRenderFrame* frame =
662 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 662 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
663 frame->Navigate(common_params, StartNavigationParams(), request_params); 663 frame->Navigate(common_params, StartNavigationParams(), request_params);
664 664
665 // The load actually happens asynchronously, so we pump messages to process 665 // The load actually happens asynchronously, so we pump messages to process
666 // the pending continuation. 666 // the pending continuation.
667 FrameLoadWaiter(frame).Wait(); 667 FrameLoadWaiter(frame).Wait();
668 view_->GetWebView()->updateAllLifecyclePhases(); 668 view_->GetWebView()->updateAllLifecyclePhases();
669 } 669 }
670 670
671 } // namespace content 671 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698