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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 | 438 |
439 void RenderViewTest::SetFocused(const blink::WebNode& node) { | 439 void RenderViewTest::SetFocused(const blink::WebNode& node) { |
440 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 440 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
441 impl->focusedNodeChanged(blink::WebNode(), node); | 441 impl->focusedNodeChanged(blink::WebNode(), node); |
442 } | 442 } |
443 | 443 |
444 void RenderViewTest::Reload(const GURL& url) { | 444 void RenderViewTest::Reload(const GURL& url) { |
445 CommonNavigationParams common_params( | 445 CommonNavigationParams common_params( |
446 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD, | 446 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD, |
447 true, false, base::TimeTicks(), | 447 true, false, base::TimeTicks(), |
448 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL()); | 448 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), |
| 449 LOFI_UNSPECIFIED); |
449 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 450 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
450 TestRenderFrame* frame = | 451 TestRenderFrame* frame = |
451 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 452 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
452 frame->Navigate(common_params, StartNavigationParams(), | 453 frame->Navigate(common_params, StartNavigationParams(), |
453 RequestNavigationParams()); | 454 RequestNavigationParams()); |
454 FrameLoadWaiter(frame).Wait(); | 455 FrameLoadWaiter(frame).Wait(); |
455 } | 456 } |
456 | 457 |
457 uint32 RenderViewTest::GetNavigationIPCType() { | 458 uint32 RenderViewTest::GetNavigationIPCType() { |
458 return FrameHostMsg_DidCommitProvisionalLoad::ID; | 459 return FrameHostMsg_DidCommitProvisionalLoad::ID; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 void RenderViewTest::GoToOffset(int offset, const PageState& state) { | 571 void RenderViewTest::GoToOffset(int offset, const PageState& state) { |
571 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 572 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
572 | 573 |
573 int history_list_length = impl->historyBackListCount() + | 574 int history_list_length = impl->historyBackListCount() + |
574 impl->historyForwardListCount() + 1; | 575 impl->historyForwardListCount() + 1; |
575 int pending_offset = offset + impl->history_list_offset_; | 576 int pending_offset = offset + impl->history_list_offset_; |
576 | 577 |
577 CommonNavigationParams common_params( | 578 CommonNavigationParams common_params( |
578 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, | 579 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, |
579 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(), | 580 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(), |
580 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL()); | 581 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), |
| 582 LOFI_UNSPECIFIED); |
581 RequestNavigationParams request_params; | 583 RequestNavigationParams request_params; |
582 request_params.page_state = state; | 584 request_params.page_state = state; |
583 request_params.page_id = impl->page_id_ + offset; | 585 request_params.page_id = impl->page_id_ + offset; |
584 request_params.nav_entry_id = pending_offset + 1; | 586 request_params.nav_entry_id = pending_offset + 1; |
585 request_params.pending_history_list_offset = pending_offset; | 587 request_params.pending_history_list_offset = pending_offset; |
586 request_params.current_history_list_offset = impl->history_list_offset_; | 588 request_params.current_history_list_offset = impl->history_list_offset_; |
587 request_params.current_history_list_length = history_list_length; | 589 request_params.current_history_list_length = history_list_length; |
588 | 590 |
589 TestRenderFrame* frame = | 591 TestRenderFrame* frame = |
590 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 592 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
591 frame->Navigate(common_params, StartNavigationParams(), request_params); | 593 frame->Navigate(common_params, StartNavigationParams(), request_params); |
592 | 594 |
593 // The load actually happens asynchronously, so we pump messages to process | 595 // The load actually happens asynchronously, so we pump messages to process |
594 // the pending continuation. | 596 // the pending continuation. |
595 FrameLoadWaiter(frame).Wait(); | 597 FrameLoadWaiter(frame).Wait(); |
596 } | 598 } |
597 | 599 |
598 } // namespace content | 600 } // namespace content |
OLD | NEW |