| 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 <cctype> | 7 #include <cctype> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 } | 425 } |
| 426 | 426 |
| 427 void RenderViewTest::SetFocused(const blink::WebNode& node) { | 427 void RenderViewTest::SetFocused(const blink::WebNode& node) { |
| 428 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 428 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
| 429 impl->focusedNodeChanged(blink::WebNode(), node); | 429 impl->focusedNodeChanged(blink::WebNode(), node); |
| 430 } | 430 } |
| 431 | 431 |
| 432 void RenderViewTest::Reload(const GURL& url) { | 432 void RenderViewTest::Reload(const GURL& url) { |
| 433 CommonNavigationParams common_params( | 433 CommonNavigationParams common_params( |
| 434 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD, | 434 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD, |
| 435 true, base::TimeTicks(), FrameMsg_UILoadMetricsReportType::NO_REPORT, | 435 true, false, base::TimeTicks(), |
| 436 GURL(), GURL()); | 436 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL()); |
| 437 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 437 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
| 438 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(), | 438 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(), |
| 439 RequestNavigationParams()); | 439 RequestNavigationParams()); |
| 440 FrameLoadWaiter(impl->GetMainRenderFrame()).Wait(); | 440 FrameLoadWaiter(impl->GetMainRenderFrame()).Wait(); |
| 441 } | 441 } |
| 442 | 442 |
| 443 uint32 RenderViewTest::GetNavigationIPCType() { | 443 uint32 RenderViewTest::GetNavigationIPCType() { |
| 444 return FrameHostMsg_DidCommitProvisionalLoad::ID; | 444 return FrameHostMsg_DidCommitProvisionalLoad::ID; |
| 445 } | 445 } |
| 446 | 446 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 | 555 |
| 556 void RenderViewTest::GoToOffset(int offset, const PageState& state) { | 556 void RenderViewTest::GoToOffset(int offset, const PageState& state) { |
| 557 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 557 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
| 558 | 558 |
| 559 int history_list_length = impl->historyBackListCount() + | 559 int history_list_length = impl->historyBackListCount() + |
| 560 impl->historyForwardListCount() + 1; | 560 impl->historyForwardListCount() + 1; |
| 561 int pending_offset = offset + impl->history_list_offset_; | 561 int pending_offset = offset + impl->history_list_offset_; |
| 562 | 562 |
| 563 CommonNavigationParams common_params( | 563 CommonNavigationParams common_params( |
| 564 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, | 564 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, |
| 565 FrameMsg_Navigate_Type::NORMAL, true, base::TimeTicks(), | 565 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(), |
| 566 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL()); | 566 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL()); |
| 567 RequestNavigationParams request_params; | 567 RequestNavigationParams request_params; |
| 568 request_params.page_state = state; | 568 request_params.page_state = state; |
| 569 request_params.page_id = impl->page_id_ + offset; | 569 request_params.page_id = impl->page_id_ + offset; |
| 570 request_params.nav_entry_id = pending_offset + 1; | 570 request_params.nav_entry_id = pending_offset + 1; |
| 571 request_params.pending_history_list_offset = pending_offset; | 571 request_params.pending_history_list_offset = pending_offset; |
| 572 request_params.current_history_list_offset = impl->history_list_offset_; | 572 request_params.current_history_list_offset = impl->history_list_offset_; |
| 573 request_params.current_history_list_length = history_list_length; | 573 request_params.current_history_list_length = history_list_length; |
| 574 | 574 |
| 575 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(), | 575 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(), |
| 576 request_params); | 576 request_params); |
| 577 | 577 |
| 578 // The load actually happens asynchronously, so we pump messages to process | 578 // The load actually happens asynchronously, so we pump messages to process |
| 579 // the pending continuation. | 579 // the pending continuation. |
| 580 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); | 580 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); |
| 581 } | 581 } |
| 582 | 582 |
| 583 } // namespace content | 583 } // namespace content |
| OLD | NEW |