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 "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "content/common/dom_storage/dom_storage_types.h" | 8 #include "content/common/dom_storage/dom_storage_types.h" |
9 #include "content/common/frame_messages.h" | 9 #include "content/common/frame_messages.h" |
10 #include "content/common/input_messages.h" | 10 #include "content/common/input_messages.h" |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 | 405 |
406 void RenderViewTest::GoToOffset(int offset, const PageState& state) { | 406 void RenderViewTest::GoToOffset(int offset, const PageState& state) { |
407 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 407 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
408 | 408 |
409 int history_list_length = impl->historyBackListCount() + | 409 int history_list_length = impl->historyBackListCount() + |
410 impl->historyForwardListCount() + 1; | 410 impl->historyForwardListCount() + 1; |
411 int pending_offset = offset + impl->history_list_offset(); | 411 int pending_offset = offset + impl->history_list_offset(); |
412 | 412 |
413 FrameMsg_Navigate_Params navigate_params; | 413 FrameMsg_Navigate_Params navigate_params; |
414 navigate_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | 414 navigate_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
415 navigate_params.transition = PAGE_TRANSITION_FORWARD_BACK; | 415 navigate_params.transition = ui::PAGE_TRANSITION_FORWARD_BACK; |
416 navigate_params.current_history_list_length = history_list_length; | 416 navigate_params.current_history_list_length = history_list_length; |
417 navigate_params.current_history_list_offset = impl->history_list_offset(); | 417 navigate_params.current_history_list_offset = impl->history_list_offset(); |
418 navigate_params.pending_history_list_offset = pending_offset; | 418 navigate_params.pending_history_list_offset = pending_offset; |
419 navigate_params.page_id = impl->page_id_ + offset; | 419 navigate_params.page_id = impl->page_id_ + offset; |
420 navigate_params.page_state = state; | 420 navigate_params.page_state = state; |
421 navigate_params.request_time = base::Time::Now(); | 421 navigate_params.request_time = base::Time::Now(); |
422 | 422 |
423 FrameMsg_Navigate navigate_message(impl->GetMainRenderFrame()->GetRoutingID(), | 423 FrameMsg_Navigate navigate_message(impl->GetMainRenderFrame()->GetRoutingID(), |
424 navigate_params); | 424 navigate_params); |
425 impl->GetMainRenderFrame()->OnMessageReceived(navigate_message); | 425 impl->GetMainRenderFrame()->OnMessageReceived(navigate_message); |
426 | 426 |
427 // The load actually happens asynchronously, so we pump messages to process | 427 // The load actually happens asynchronously, so we pump messages to process |
428 // the pending continuation. | 428 // the pending continuation. |
429 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); | 429 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); |
430 } | 430 } |
431 | 431 |
432 } // namespace content | 432 } // namespace content |
OLD | NEW |