| 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 320 |
| 321 void RenderViewTest::ClearHistory() { | 321 void RenderViewTest::ClearHistory() { |
| 322 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 322 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
| 323 impl->page_id_ = -1; | 323 impl->page_id_ = -1; |
| 324 impl->history_list_offset_ = -1; | 324 impl->history_list_offset_ = -1; |
| 325 impl->history_list_length_ = 0; | 325 impl->history_list_length_ = 0; |
| 326 impl->history_page_ids_.clear(); | 326 impl->history_page_ids_.clear(); |
| 327 } | 327 } |
| 328 | 328 |
| 329 void RenderViewTest::Reload(const GURL& url) { | 329 void RenderViewTest::Reload(const GURL& url) { |
| 330 ViewMsg_Navigate_Params params; | 330 FrameMsg_Navigate_Params params; |
| 331 params.url = url; | 331 params.url = url; |
| 332 params.navigation_type = ViewMsg_Navigate_Type::RELOAD; | 332 params.navigation_type = FrameMsg_Navigate_Type::RELOAD; |
| 333 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 333 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
| 334 impl->OnNavigate(params); | 334 impl->OnNavigate(params); |
| 335 } | 335 } |
| 336 | 336 |
| 337 uint32 RenderViewTest::GetNavigationIPCType() { | 337 uint32 RenderViewTest::GetNavigationIPCType() { |
| 338 return FrameHostMsg_DidCommitProvisionalLoad::ID; | 338 return FrameHostMsg_DidCommitProvisionalLoad::ID; |
| 339 } | 339 } |
| 340 | 340 |
| 341 void RenderViewTest::Resize(gfx::Size new_size, | 341 void RenderViewTest::Resize(gfx::Size new_size, |
| 342 gfx::Rect resizer_rect, | 342 gfx::Rect resizer_rect, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 } | 374 } |
| 375 | 375 |
| 376 void RenderViewTest::GoToOffset(int offset, | 376 void RenderViewTest::GoToOffset(int offset, |
| 377 const blink::WebHistoryItem& history_item) { | 377 const blink::WebHistoryItem& history_item) { |
| 378 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 378 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
| 379 | 379 |
| 380 int history_list_length = impl->historyBackListCount() + | 380 int history_list_length = impl->historyBackListCount() + |
| 381 impl->historyForwardListCount() + 1; | 381 impl->historyForwardListCount() + 1; |
| 382 int pending_offset = offset + impl->history_list_offset(); | 382 int pending_offset = offset + impl->history_list_offset(); |
| 383 | 383 |
| 384 ViewMsg_Navigate_Params navigate_params; | 384 FrameMsg_Navigate_Params navigate_params; |
| 385 navigate_params.navigation_type = ViewMsg_Navigate_Type::NORMAL; | 385 navigate_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
| 386 navigate_params.transition = PAGE_TRANSITION_FORWARD_BACK; | 386 navigate_params.transition = PAGE_TRANSITION_FORWARD_BACK; |
| 387 navigate_params.current_history_list_length = history_list_length; | 387 navigate_params.current_history_list_length = history_list_length; |
| 388 navigate_params.current_history_list_offset = impl->history_list_offset(); | 388 navigate_params.current_history_list_offset = impl->history_list_offset(); |
| 389 navigate_params.pending_history_list_offset = pending_offset; | 389 navigate_params.pending_history_list_offset = pending_offset; |
| 390 navigate_params.page_id = impl->GetPageId() + offset; | 390 navigate_params.page_id = impl->GetPageId() + offset; |
| 391 navigate_params.page_state = HistoryItemToPageState(history_item); | 391 navigate_params.page_state = HistoryItemToPageState(history_item); |
| 392 navigate_params.request_time = base::Time::Now(); | 392 navigate_params.request_time = base::Time::Now(); |
| 393 | 393 |
| 394 ViewMsg_Navigate navigate_message(impl->GetRoutingID(), navigate_params); | 394 FrameMsg_Navigate navigate_message(impl->GetRoutingID(), navigate_params); |
| 395 OnMessageReceived(navigate_message); | 395 OnMessageReceived(navigate_message); |
| 396 | 396 |
| 397 // The load actually happens asynchronously, so we pump messages to process | 397 // The load actually happens asynchronously, so we pump messages to process |
| 398 // the pending continuation. | 398 // the pending continuation. |
| 399 ProcessPendingMessages(); | 399 ProcessPendingMessages(); |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace content | 402 } // namespace content |
| OLD | NEW |