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