| 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 TestRenderFrame* frame = | 438 TestRenderFrame* frame = |
| 439 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 439 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
| 440 frame->Navigate(common_params, StartNavigationParams(), | 440 frame->Navigate(common_params, StartNavigationParams(), |
| 441 RequestNavigationParams()); | 441 RequestNavigationParams()); |
| 442 FrameLoadWaiter(frame).Wait(); | 442 FrameLoadWaiter(frame).Wait(); |
| 443 } | 443 } |
| 444 | 444 |
| 445 uint32 RenderViewTest::GetNavigationIPCType() { | 445 uint32 RenderViewTest::GetNavigationIPCType() { |
| 446 return FrameHostMsg_DidCommitProvisionalLoad::ID; | 446 return FrameHostMsg_DidCommitProvisionalLoad::ID; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 | 557 |
| 558 void RenderViewTest::GoToOffset(int offset, const PageState& state) { | 558 void RenderViewTest::GoToOffset(int offset, const PageState& state) { |
| 559 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 559 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
| 560 | 560 |
| 561 int history_list_length = impl->historyBackListCount() + | 561 int history_list_length = impl->historyBackListCount() + |
| 562 impl->historyForwardListCount() + 1; | 562 impl->historyForwardListCount() + 1; |
| 563 int pending_offset = offset + impl->history_list_offset_; | 563 int pending_offset = offset + impl->history_list_offset_; |
| 564 | 564 |
| 565 CommonNavigationParams common_params( | 565 CommonNavigationParams common_params( |
| 566 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, | 566 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, |
| 567 FrameMsg_Navigate_Type::NORMAL, true, base::TimeTicks(), | 567 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(), |
| 568 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL()); | 568 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL()); |
| 569 RequestNavigationParams request_params; | 569 RequestNavigationParams request_params; |
| 570 request_params.page_state = state; | 570 request_params.page_state = state; |
| 571 request_params.page_id = impl->page_id_ + offset; | 571 request_params.page_id = impl->page_id_ + offset; |
| 572 request_params.nav_entry_id = pending_offset + 1; | 572 request_params.nav_entry_id = pending_offset + 1; |
| 573 request_params.pending_history_list_offset = pending_offset; | 573 request_params.pending_history_list_offset = pending_offset; |
| 574 request_params.current_history_list_offset = impl->history_list_offset_; | 574 request_params.current_history_list_offset = impl->history_list_offset_; |
| 575 request_params.current_history_list_length = history_list_length; | 575 request_params.current_history_list_length = history_list_length; |
| 576 | 576 |
| 577 TestRenderFrame* frame = | 577 TestRenderFrame* frame = |
| 578 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 578 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
| 579 frame->Navigate(common_params, StartNavigationParams(), request_params); | 579 frame->Navigate(common_params, StartNavigationParams(), request_params); |
| 580 | 580 |
| 581 // The load actually happens asynchronously, so we pump messages to process | 581 // The load actually happens asynchronously, so we pump messages to process |
| 582 // the pending continuation. | 582 // the pending continuation. |
| 583 FrameLoadWaiter(frame).Wait(); | 583 FrameLoadWaiter(frame).Wait(); |
| 584 } | 584 } |
| 585 | 585 |
| 586 } // namespace content | 586 } // namespace content |
| OLD | NEW |