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