OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // in OnRequestResource(). | 61 // in OnRequestResource(). |
62 content::GetContentClient()->set_renderer(&content_renderer_client_); | 62 content::GetContentClient()->set_renderer(&content_renderer_client_); |
63 static const char kThreadName[] = "RenderViewFakeResourcesTest"; | 63 static const char kThreadName[] = "RenderViewFakeResourcesTest"; |
64 channel_.reset(new IPC::Channel(kThreadName, | 64 channel_.reset(new IPC::Channel(kThreadName, |
65 IPC::Channel::MODE_SERVER, this)); | 65 IPC::Channel::MODE_SERVER, this)); |
66 ASSERT_TRUE(channel_->Connect()); | 66 ASSERT_TRUE(channel_->Connect()); |
67 | 67 |
68 webkit_glue::SetJavaScriptFlags("--expose-gc"); | 68 webkit_glue::SetJavaScriptFlags("--expose-gc"); |
69 mock_process_.reset(new MockRenderProcess); | 69 mock_process_.reset(new MockRenderProcess); |
70 render_thread_ = new RenderThreadImpl(kThreadName); | 70 render_thread_ = new RenderThreadImpl(kThreadName); |
71 mock_process_->set_main_thread(render_thread_); | |
72 #if defined(OS_MACOSX) | 71 #if defined(OS_MACOSX) |
73 InitWebCoreSystemInterface(); | 72 InitWebCoreSystemInterface(); |
74 #endif | 73 #endif |
75 | 74 |
76 // Tell the renderer to create a view, then wait until it's ready. | 75 // Tell the renderer to create a view, then wait until it's ready. |
77 // We can't call View::Create() directly here or else we won't get | 76 // We can't call View::Create() directly here or else we won't get |
78 // RenderProcess's lazy initialization of WebKit. | 77 // RenderProcess's lazy initialization of WebKit. |
79 view_ = NULL; | 78 view_ = NULL; |
80 ViewMsg_New_Params params; | 79 ViewMsg_New_Params params; |
81 params.parent_window = 0; | 80 params.parent_window = 0; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 params.current_history_list_length = (impl->historyBackListCount() + | 197 params.current_history_list_length = (impl->historyBackListCount() + |
199 impl->historyForwardListCount() + 1); | 198 impl->historyForwardListCount() + 1); |
200 params.url = GURL(history_item.urlString()); | 199 params.url = GURL(history_item.urlString()); |
201 params.transition = content::PAGE_TRANSITION_FORWARD_BACK; | 200 params.transition = content::PAGE_TRANSITION_FORWARD_BACK; |
202 params.state = webkit_glue::HistoryItemToString(history_item); | 201 params.state = webkit_glue::HistoryItemToString(history_item); |
203 params.navigation_type = ViewMsg_Navigate_Type::NORMAL; | 202 params.navigation_type = ViewMsg_Navigate_Type::NORMAL; |
204 params.request_time = base::Time::Now(); | 203 params.request_time = base::Time::Now(); |
205 channel_->Send(new ViewMsg_Navigate(impl->routing_id(), params)); | 204 channel_->Send(new ViewMsg_Navigate(impl->routing_id(), params)); |
206 message_loop_.Run(); | 205 message_loop_.Run(); |
207 } | 206 } |
OLD | NEW |