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