| 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/shared_memory.h" | 10 #include "base/shared_memory.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 return false; | 50 return false; |
| 51 } | 51 } |
| 52 | 52 |
| 53 void RenderViewFakeResourcesTest::SetUp() { | 53 void RenderViewFakeResourcesTest::SetUp() { |
| 54 // Set up the renderer. This code is largely adapted from | 54 // Set up the renderer. This code is largely adapted from |
| 55 // render_view_test.cc and renderer_main.cc. Note that we use a | 55 // render_view_test.cc and renderer_main.cc. Note that we use a |
| 56 // MockRenderProcess (because we don't need to use IPC for painting), | 56 // MockRenderProcess (because we don't need to use IPC for painting), |
| 57 // but we use a real RenderThread so that we can use the ResourceDispatcher | 57 // but we use a real RenderThread so that we can use the ResourceDispatcher |
| 58 // to fetch network resources. These are then served canned content | 58 // to fetch network resources. These are then served canned content |
| 59 // in OnRequestResource(). | 59 // in OnRequestResource(). |
| 60 GetContentClient()->set_renderer(&content_renderer_client_); | 60 GetContentClient()->set_renderer_for_testing(&content_renderer_client_); |
| 61 // Generate a unique channel id so that multiple instances of the test can | 61 // Generate a unique channel id so that multiple instances of the test can |
| 62 // run in parallel. | 62 // run in parallel. |
| 63 std::string channel_id = IPC::Channel::GenerateVerifiedChannelID( | 63 std::string channel_id = IPC::Channel::GenerateVerifiedChannelID( |
| 64 std::string()); | 64 std::string()); |
| 65 channel_.reset(new IPC::Channel(channel_id, | 65 channel_.reset(new IPC::Channel(channel_id, |
| 66 IPC::Channel::MODE_SERVER, this)); | 66 IPC::Channel::MODE_SERVER, this)); |
| 67 ASSERT_TRUE(channel_->Connect()); | 67 ASSERT_TRUE(channel_->Connect()); |
| 68 | 68 |
| 69 webkit_glue::SetJavaScriptFlags("--expose-gc"); | 69 webkit_glue::SetJavaScriptFlags("--expose-gc"); |
| 70 mock_process_.reset(new MockRenderProcess); | 70 mock_process_.reset(new MockRenderProcess); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 params.url = GURL(history_item.urlString()); | 199 params.url = GURL(history_item.urlString()); |
| 200 params.transition = PAGE_TRANSITION_FORWARD_BACK; | 200 params.transition = PAGE_TRANSITION_FORWARD_BACK; |
| 201 params.state = webkit_glue::HistoryItemToString(history_item); | 201 params.state = webkit_glue::HistoryItemToString(history_item); |
| 202 params.navigation_type = ViewMsg_Navigate_Type::NORMAL; | 202 params.navigation_type = ViewMsg_Navigate_Type::NORMAL; |
| 203 params.request_time = base::Time::Now(); | 203 params.request_time = base::Time::Now(); |
| 204 channel_->Send(new ViewMsg_Navigate(impl->routing_id(), params)); | 204 channel_->Send(new ViewMsg_Navigate(impl->routing_id(), params)); |
| 205 message_loop_.Run(); | 205 message_loop_.Run(); |
| 206 } | 206 } |
| 207 | 207 |
| 208 } // namespace content | 208 } // namespace content |
| OLD | NEW |