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/test/render_view_fake_resources_test.h" | 5 #include "content/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/shared_memory.h" | 10 #include "base/shared_memory.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
12 #include "content/common/resource_messages.h" | 12 #include "content/common/resource_messages.h" |
13 #include "content/common/view_messages.h" | 13 #include "content/common/view_messages.h" |
14 #include "content/public/common/resource_response.h" | 14 #include "content/public/common/resource_response.h" |
15 #include "content/renderer/render_thread_impl.h" | |
16 #include "content/renderer/render_view_impl.h" | 15 #include "content/renderer/render_view_impl.h" |
| 16 #include "content/test/render_test_utils.h" |
17 #include "content/test/mock_render_process.h" | 17 #include "content/test/mock_render_process.h" |
18 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
19 #include "net/base/upload_data.h" | 19 #include "net/base/upload_data.h" |
20 #include "net/http/http_response_headers.h" | 20 #include "net/http/http_response_headers.h" |
21 #include "net/url_request/url_request_status.h" | 21 #include "net/url_request/url_request_status.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // Generate a unique channel id so that multiple instances of the test can | 59 // Generate a unique channel id so that multiple instances of the test can |
60 // run in parallel. | 60 // run in parallel. |
61 std::string channel_id = IPC::Channel::GenerateVerifiedChannelID( | 61 std::string channel_id = IPC::Channel::GenerateVerifiedChannelID( |
62 std::string()); | 62 std::string()); |
63 channel_.reset(new IPC::Channel(channel_id, | 63 channel_.reset(new IPC::Channel(channel_id, |
64 IPC::Channel::MODE_SERVER, this)); | 64 IPC::Channel::MODE_SERVER, this)); |
65 ASSERT_TRUE(channel_->Connect()); | 65 ASSERT_TRUE(channel_->Connect()); |
66 | 66 |
67 webkit_glue::SetJavaScriptFlags("--expose-gc"); | 67 webkit_glue::SetJavaScriptFlags("--expose-gc"); |
68 mock_process_.reset(new MockRenderProcess); | 68 mock_process_.reset(new MockRenderProcess); |
69 render_thread_ = new RenderThreadImpl(channel_id); | 69 render_thread_ = new content::RenderThreadImplNoSandbox(channel_id); |
70 | 70 |
71 // Tell the renderer to create a view, then wait until it's ready. | 71 // Tell the renderer to create a view, then wait until it's ready. |
72 // We can't call View::Create() directly here or else we won't get | 72 // We can't call View::Create() directly here or else we won't get |
73 // RenderProcess's lazy initialization of WebKit. | 73 // RenderProcess's lazy initialization of WebKit. |
74 view_ = NULL; | 74 view_ = NULL; |
75 ViewMsg_New_Params params; | 75 ViewMsg_New_Params params; |
76 params.parent_window = 0; | 76 params.parent_window = 0; |
77 params.view_id = kViewId; | 77 params.view_id = kViewId; |
78 params.opener_route_id = MSG_ROUTING_NONE; | 78 params.opener_route_id = MSG_ROUTING_NONE; |
79 params.session_storage_namespace_id = | 79 params.session_storage_namespace_id = |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 params.current_history_list_length = (impl->historyBackListCount() + | 195 params.current_history_list_length = (impl->historyBackListCount() + |
196 impl->historyForwardListCount() + 1); | 196 impl->historyForwardListCount() + 1); |
197 params.url = GURL(history_item.urlString()); | 197 params.url = GURL(history_item.urlString()); |
198 params.transition = content::PAGE_TRANSITION_FORWARD_BACK; | 198 params.transition = content::PAGE_TRANSITION_FORWARD_BACK; |
199 params.state = webkit_glue::HistoryItemToString(history_item); | 199 params.state = webkit_glue::HistoryItemToString(history_item); |
200 params.navigation_type = ViewMsg_Navigate_Type::NORMAL; | 200 params.navigation_type = ViewMsg_Navigate_Type::NORMAL; |
201 params.request_time = base::Time::Now(); | 201 params.request_time = base::Time::Now(); |
202 channel_->Send(new ViewMsg_Navigate(impl->routing_id(), params)); | 202 channel_->Send(new ViewMsg_Navigate(impl->routing_id(), params)); |
203 message_loop_.Run(); | 203 message_loop_.Run(); |
204 } | 204 } |
OLD | NEW |