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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 void RenderViewTest::SetFocused(const blink::WebNode& node) { | 448 void RenderViewTest::SetFocused(const blink::WebNode& node) { |
449 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 449 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
450 impl->focusedNodeChanged(blink::WebNode(), node); | 450 impl->focusedNodeChanged(blink::WebNode(), node); |
451 } | 451 } |
452 | 452 |
453 void RenderViewTest::Reload(const GURL& url) { | 453 void RenderViewTest::Reload(const GURL& url) { |
454 CommonNavigationParams common_params( | 454 CommonNavigationParams common_params( |
455 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD, | 455 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD, |
456 true, false, base::TimeTicks(), | 456 true, false, base::TimeTicks(), |
457 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), | 457 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), |
458 LOFI_UNSPECIFIED); | 458 LOFI_UNSPECIFIED, base::TimeTicks::Now()); |
459 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 459 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
460 TestRenderFrame* frame = | 460 TestRenderFrame* frame = |
461 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 461 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
462 frame->Navigate(common_params, StartNavigationParams(), | 462 frame->Navigate(common_params, StartNavigationParams(), |
463 RequestNavigationParams()); | 463 RequestNavigationParams()); |
464 FrameLoadWaiter(frame).Wait(); | 464 FrameLoadWaiter(frame).Wait(); |
465 } | 465 } |
466 | 466 |
467 uint32 RenderViewTest::GetNavigationIPCType() { | 467 uint32 RenderViewTest::GetNavigationIPCType() { |
468 return FrameHostMsg_DidCommitProvisionalLoad::ID; | 468 return FrameHostMsg_DidCommitProvisionalLoad::ID; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 581 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
582 | 582 |
583 int history_list_length = impl->historyBackListCount() + | 583 int history_list_length = impl->historyBackListCount() + |
584 impl->historyForwardListCount() + 1; | 584 impl->historyForwardListCount() + 1; |
585 int pending_offset = offset + impl->history_list_offset_; | 585 int pending_offset = offset + impl->history_list_offset_; |
586 | 586 |
587 CommonNavigationParams common_params( | 587 CommonNavigationParams common_params( |
588 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, | 588 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, |
589 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(), | 589 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(), |
590 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), | 590 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), |
591 LOFI_UNSPECIFIED); | 591 LOFI_UNSPECIFIED, base::TimeTicks::Now()); |
592 RequestNavigationParams request_params; | 592 RequestNavigationParams request_params; |
593 request_params.page_state = state; | 593 request_params.page_state = state; |
594 request_params.page_id = impl->page_id_ + offset; | 594 request_params.page_id = impl->page_id_ + offset; |
595 request_params.nav_entry_id = pending_offset + 1; | 595 request_params.nav_entry_id = pending_offset + 1; |
596 request_params.pending_history_list_offset = pending_offset; | 596 request_params.pending_history_list_offset = pending_offset; |
597 request_params.current_history_list_offset = impl->history_list_offset_; | 597 request_params.current_history_list_offset = impl->history_list_offset_; |
598 request_params.current_history_list_length = history_list_length; | 598 request_params.current_history_list_length = history_list_length; |
599 | 599 |
600 TestRenderFrame* frame = | 600 TestRenderFrame* frame = |
601 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 601 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
602 frame->Navigate(common_params, StartNavigationParams(), request_params); | 602 frame->Navigate(common_params, StartNavigationParams(), request_params); |
603 | 603 |
604 // The load actually happens asynchronously, so we pump messages to process | 604 // The load actually happens asynchronously, so we pump messages to process |
605 // the pending continuation. | 605 // the pending continuation. |
606 FrameLoadWaiter(frame).Wait(); | 606 FrameLoadWaiter(frame).Wait(); |
607 } | 607 } |
608 | 608 |
609 } // namespace content | 609 } // namespace content |
OLD | NEW |