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