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