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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 true, false, base::TimeTicks(), | 518 true, false, base::TimeTicks(), |
519 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), | 519 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), |
520 PREVIEWS_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr, | 520 PREVIEWS_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr, |
521 base::Optional<SourceLocation>(), | 521 base::Optional<SourceLocation>()); |
522 CSPDisposition::CHECK /* should_check_main_world_csp */); | |
523 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 522 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
524 TestRenderFrame* frame = | 523 TestRenderFrame* frame = |
525 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 524 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
526 frame->Navigate(common_params, StartNavigationParams(), | 525 frame->Navigate(common_params, StartNavigationParams(), |
527 RequestNavigationParams()); | 526 RequestNavigationParams()); |
528 FrameLoadWaiter(frame).Wait(); | 527 FrameLoadWaiter(frame).Wait(); |
529 view_->GetWebView()->updateAllLifecyclePhases(); | 528 view_->GetWebView()->updateAllLifecyclePhases(); |
530 } | 529 } |
531 | 530 |
532 uint32_t RenderViewTest::GetNavigationIPCType() { | 531 uint32_t RenderViewTest::GetNavigationIPCType() { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 | 649 |
651 int history_list_length = impl->historyBackListCount() + | 650 int history_list_length = impl->historyBackListCount() + |
652 impl->historyForwardListCount() + 1; | 651 impl->historyForwardListCount() + 1; |
653 int pending_offset = offset + impl->history_list_offset_; | 652 int pending_offset = offset + impl->history_list_offset_; |
654 | 653 |
655 CommonNavigationParams common_params( | 654 CommonNavigationParams common_params( |
656 url, Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, | 655 url, Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, |
657 FrameMsg_Navigate_Type::HISTORY_DIFFERENT_DOCUMENT, true, false, | 656 FrameMsg_Navigate_Type::HISTORY_DIFFERENT_DOCUMENT, true, false, |
658 base::TimeTicks(), FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), | 657 base::TimeTicks(), FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), |
659 GURL(), PREVIEWS_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr, | 658 GURL(), PREVIEWS_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr, |
660 base::Optional<SourceLocation>(), | 659 base::Optional<SourceLocation>()); |
661 CSPDisposition::CHECK /* should_check_main_world_csp */); | |
662 RequestNavigationParams request_params; | 660 RequestNavigationParams request_params; |
663 request_params.page_state = state; | 661 request_params.page_state = state; |
664 request_params.nav_entry_id = pending_offset + 1; | 662 request_params.nav_entry_id = pending_offset + 1; |
665 request_params.pending_history_list_offset = pending_offset; | 663 request_params.pending_history_list_offset = pending_offset; |
666 request_params.current_history_list_offset = impl->history_list_offset_; | 664 request_params.current_history_list_offset = impl->history_list_offset_; |
667 request_params.current_history_list_length = history_list_length; | 665 request_params.current_history_list_length = history_list_length; |
668 | 666 |
669 TestRenderFrame* frame = | 667 TestRenderFrame* frame = |
670 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 668 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
671 frame->Navigate(common_params, StartNavigationParams(), request_params); | 669 frame->Navigate(common_params, StartNavigationParams(), request_params); |
672 | 670 |
673 // The load actually happens asynchronously, so we pump messages to process | 671 // The load actually happens asynchronously, so we pump messages to process |
674 // the pending continuation. | 672 // the pending continuation. |
675 FrameLoadWaiter(frame).Wait(); | 673 FrameLoadWaiter(frame).Wait(); |
676 view_->GetWebView()->updateAllLifecyclePhases(); | 674 view_->GetWebView()->updateAllLifecyclePhases(); |
677 } | 675 } |
678 | 676 |
679 } // namespace content | 677 } // namespace content |
OLD | NEW |