| 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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 void RenderViewTest::SetFocused(const blink::WebNode& node) { | 570 void RenderViewTest::SetFocused(const blink::WebNode& node) { |
| 571 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 571 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
| 572 impl->focusedNodeChanged(blink::WebNode(), node); | 572 impl->focusedNodeChanged(blink::WebNode(), node); |
| 573 } | 573 } |
| 574 | 574 |
| 575 void RenderViewTest::Reload(const GURL& url) { | 575 void RenderViewTest::Reload(const GURL& url) { |
| 576 CommonNavigationParams common_params( | 576 CommonNavigationParams common_params( |
| 577 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD, | 577 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD, |
| 578 true, false, base::TimeTicks(), | 578 true, false, base::TimeTicks(), |
| 579 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), | 579 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), |
| 580 LOFI_UNSPECIFIED, base::TimeTicks::Now()); | 580 LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET"); |
| 581 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 581 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
| 582 TestRenderFrame* frame = | 582 TestRenderFrame* frame = |
| 583 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 583 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
| 584 frame->Navigate(common_params, StartNavigationParams(), | 584 frame->Navigate(common_params, StartNavigationParams(), |
| 585 RequestNavigationParams()); | 585 RequestNavigationParams()); |
| 586 FrameLoadWaiter(frame).Wait(); | 586 FrameLoadWaiter(frame).Wait(); |
| 587 } | 587 } |
| 588 | 588 |
| 589 uint32_t RenderViewTest::GetNavigationIPCType() { | 589 uint32_t RenderViewTest::GetNavigationIPCType() { |
| 590 return FrameHostMsg_DidCommitProvisionalLoad::ID; | 590 return FrameHostMsg_DidCommitProvisionalLoad::ID; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 703 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
| 704 | 704 |
| 705 int history_list_length = impl->historyBackListCount() + | 705 int history_list_length = impl->historyBackListCount() + |
| 706 impl->historyForwardListCount() + 1; | 706 impl->historyForwardListCount() + 1; |
| 707 int pending_offset = offset + impl->history_list_offset_; | 707 int pending_offset = offset + impl->history_list_offset_; |
| 708 | 708 |
| 709 CommonNavigationParams common_params( | 709 CommonNavigationParams common_params( |
| 710 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, | 710 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, |
| 711 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(), | 711 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(), |
| 712 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), | 712 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), |
| 713 LOFI_UNSPECIFIED, base::TimeTicks::Now()); | 713 LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET"); |
| 714 RequestNavigationParams request_params; | 714 RequestNavigationParams request_params; |
| 715 request_params.page_state = state; | 715 request_params.page_state = state; |
| 716 request_params.page_id = impl->page_id_ + offset; | 716 request_params.page_id = impl->page_id_ + offset; |
| 717 request_params.nav_entry_id = pending_offset + 1; | 717 request_params.nav_entry_id = pending_offset + 1; |
| 718 request_params.pending_history_list_offset = pending_offset; | 718 request_params.pending_history_list_offset = pending_offset; |
| 719 request_params.current_history_list_offset = impl->history_list_offset_; | 719 request_params.current_history_list_offset = impl->history_list_offset_; |
| 720 request_params.current_history_list_length = history_list_length; | 720 request_params.current_history_list_length = history_list_length; |
| 721 | 721 |
| 722 TestRenderFrame* frame = | 722 TestRenderFrame* frame = |
| 723 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 723 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
| 724 frame->Navigate(common_params, StartNavigationParams(), request_params); | 724 frame->Navigate(common_params, StartNavigationParams(), request_params); |
| 725 | 725 |
| 726 // The load actually happens asynchronously, so we pump messages to process | 726 // The load actually happens asynchronously, so we pump messages to process |
| 727 // the pending continuation. | 727 // the pending continuation. |
| 728 FrameLoadWaiter(frame).Wait(); | 728 FrameLoadWaiter(frame).Wait(); |
| 729 } | 729 } |
| 730 | 730 |
| 731 } // namespace content | 731 } // namespace content |
| OLD | NEW |