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/input_messages.h" | 8 #include "content/common/input_messages.h" |
9 #include "content/common/view_messages.h" | 9 #include "content/common/view_messages.h" |
10 #include "content/public/browser/native_web_keyboard_event.h" | 10 #include "content/public/browser/native_web_keyboard_event.h" |
11 #include "content/public/common/renderer_preferences.h" | 11 #include "content/public/common/renderer_preferences.h" |
| 12 #include "content/public/renderer/history_item_serialization.h" |
12 #include "content/renderer/render_thread_impl.h" | 13 #include "content/renderer/render_thread_impl.h" |
13 #include "content/renderer/render_view_impl.h" | 14 #include "content/renderer/render_view_impl.h" |
14 #include "content/renderer/renderer_main_platform_delegate.h" | 15 #include "content/renderer/renderer_main_platform_delegate.h" |
15 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 16 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
16 #include "content/test/mock_render_process.h" | 17 #include "content/test/mock_render_process.h" |
17 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLRequest.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLRequest.h" |
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
26 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
27 #include "webkit/dom_storage/dom_storage_types.h" | 28 #include "webkit/dom_storage/dom_storage_types.h" |
28 #include "webkit/glue/glue_serialize.h" | |
29 #include "webkit/glue/webkit_glue.h" | 29 #include "webkit/glue/webkit_glue.h" |
30 | 30 |
31 using WebKit::WebFrame; | 31 using WebKit::WebFrame; |
32 using WebKit::WebInputEvent; | 32 using WebKit::WebInputEvent; |
33 using WebKit::WebMouseEvent; | 33 using WebKit::WebMouseEvent; |
34 using WebKit::WebScriptController; | 34 using WebKit::WebScriptController; |
35 using WebKit::WebScriptSource; | 35 using WebKit::WebScriptSource; |
36 using WebKit::WebString; | 36 using WebKit::WebString; |
37 using WebKit::WebURLRequest; | 37 using WebKit::WebURLRequest; |
38 | 38 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 impl->historyForwardListCount() + 1; | 351 impl->historyForwardListCount() + 1; |
352 int pending_offset = offset + impl->history_list_offset(); | 352 int pending_offset = offset + impl->history_list_offset(); |
353 | 353 |
354 ViewMsg_Navigate_Params navigate_params; | 354 ViewMsg_Navigate_Params navigate_params; |
355 navigate_params.navigation_type = ViewMsg_Navigate_Type::NORMAL; | 355 navigate_params.navigation_type = ViewMsg_Navigate_Type::NORMAL; |
356 navigate_params.transition = PAGE_TRANSITION_FORWARD_BACK; | 356 navigate_params.transition = PAGE_TRANSITION_FORWARD_BACK; |
357 navigate_params.current_history_list_length = history_list_length; | 357 navigate_params.current_history_list_length = history_list_length; |
358 navigate_params.current_history_list_offset = impl->history_list_offset(); | 358 navigate_params.current_history_list_offset = impl->history_list_offset(); |
359 navigate_params.pending_history_list_offset = pending_offset; | 359 navigate_params.pending_history_list_offset = pending_offset; |
360 navigate_params.page_id = impl->GetPageId() + offset; | 360 navigate_params.page_id = impl->GetPageId() + offset; |
361 navigate_params.state = webkit_glue::HistoryItemToString(history_item); | 361 navigate_params.page_state = HistoryItemToPageState(history_item); |
362 navigate_params.request_time = base::Time::Now(); | 362 navigate_params.request_time = base::Time::Now(); |
363 | 363 |
364 ViewMsg_Navigate navigate_message(impl->GetRoutingID(), navigate_params); | 364 ViewMsg_Navigate navigate_message(impl->GetRoutingID(), navigate_params); |
365 OnMessageReceived(navigate_message); | 365 OnMessageReceived(navigate_message); |
366 | 366 |
367 // The load actually happens asynchronously, so we pump messages to process | 367 // The load actually happens asynchronously, so we pump messages to process |
368 // the pending continuation. | 368 // the pending continuation. |
369 ProcessPendingMessages(); | 369 ProcessPendingMessages(); |
370 } | 370 } |
371 | 371 |
372 } // namespace content | 372 } // namespace content |
OLD | NEW |