| 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_fake_resources_test.h" | 5 #include "content/public/test/render_view_fake_resources_test.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/process.h" | 9 #include "base/process.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
| 12 #include "base/time.h" | 12 #include "base/time.h" |
| 13 #include "content/common/resource_messages.h" | 13 #include "content/common/resource_messages.h" |
| 14 #include "content/common/view_messages.h" | 14 #include "content/common/view_messages.h" |
| 15 #include "content/public/common/resource_response.h" | 15 #include "content/public/common/resource_response.h" |
| 16 #include "content/public/renderer/history_item_serialization.h" |
| 16 #include "content/renderer/render_thread_impl.h" | 17 #include "content/renderer/render_thread_impl.h" |
| 17 #include "content/renderer/render_view_impl.h" | 18 #include "content/renderer/render_view_impl.h" |
| 18 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 19 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
| 19 #include "content/test/mock_render_process.h" | 20 #include "content/test/mock_render_process.h" |
| 20 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
| 21 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
| 22 #include "net/base/upload_data.h" | 23 #include "net/base/upload_data.h" |
| 23 #include "net/http/http_response_headers.h" | 24 #include "net/http/http_response_headers.h" |
| 24 #include "net/url_request/url_request_status.h" | 25 #include "net/url_request/url_request_status.h" |
| 25 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | 26 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
| 26 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLRequest.h" | 27 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLRequest.h" |
| 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" |
| 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 30 #include "webkit/dom_storage/dom_storage_types.h" | 31 #include "webkit/dom_storage/dom_storage_types.h" |
| 31 #include "webkit/glue/glue_serialize.h" | |
| 32 #include "webkit/glue/webkit_glue.h" | 32 #include "webkit/glue/webkit_glue.h" |
| 33 | 33 |
| 34 namespace content { | 34 namespace content { |
| 35 | 35 |
| 36 const int32 RenderViewFakeResourcesTest::kViewId = 5; | 36 const int32 RenderViewFakeResourcesTest::kViewId = 5; |
| 37 | 37 |
| 38 RenderViewFakeResourcesTest::RenderViewFakeResourcesTest() {} | 38 RenderViewFakeResourcesTest::RenderViewFakeResourcesTest() {} |
| 39 RenderViewFakeResourcesTest::~RenderViewFakeResourcesTest() {} | 39 RenderViewFakeResourcesTest::~RenderViewFakeResourcesTest() {} |
| 40 | 40 |
| 41 bool RenderViewFakeResourcesTest::OnMessageReceived( | 41 bool RenderViewFakeResourcesTest::OnMessageReceived( |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 206 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
| 207 ViewMsg_Navigate_Params params; | 207 ViewMsg_Navigate_Params params; |
| 208 params.page_id = impl->GetPageId() + offset; | 208 params.page_id = impl->GetPageId() + offset; |
| 209 params.pending_history_list_offset = | 209 params.pending_history_list_offset = |
| 210 impl->history_list_offset() + offset; | 210 impl->history_list_offset() + offset; |
| 211 params.current_history_list_offset = impl->history_list_offset(); | 211 params.current_history_list_offset = impl->history_list_offset(); |
| 212 params.current_history_list_length = (impl->historyBackListCount() + | 212 params.current_history_list_length = (impl->historyBackListCount() + |
| 213 impl->historyForwardListCount() + 1); | 213 impl->historyForwardListCount() + 1); |
| 214 params.url = GURL(history_item.urlString()); | 214 params.url = GURL(history_item.urlString()); |
| 215 params.transition = PAGE_TRANSITION_FORWARD_BACK; | 215 params.transition = PAGE_TRANSITION_FORWARD_BACK; |
| 216 params.state = webkit_glue::HistoryItemToString(history_item); | 216 params.page_state = HistoryItemToPageState(history_item); |
| 217 params.navigation_type = ViewMsg_Navigate_Type::NORMAL; | 217 params.navigation_type = ViewMsg_Navigate_Type::NORMAL; |
| 218 params.request_time = base::Time::Now(); | 218 params.request_time = base::Time::Now(); |
| 219 channel_->Send(new ViewMsg_Navigate(impl->routing_id(), params)); | 219 channel_->Send(new ViewMsg_Navigate(impl->routing_id(), params)); |
| 220 message_loop_.Run(); | 220 message_loop_.Run(); |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace content | 223 } // namespace content |
| OLD | NEW |