OLD | NEW |
1 // Copyright (c) 2010 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 "chrome/renderer/safe_browsing/render_view_fake_resources_test.h" | 5 #include "chrome/renderer/safe_browsing/render_view_fake_resources_test.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/process.h" | 10 #include "base/process.h" |
11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 base::SharedMemoryHandle handle; | 157 base::SharedMemoryHandle handle; |
158 ASSERT_TRUE(shared_memory.GiveToProcess(base::Process::Current().handle(), | 158 ASSERT_TRUE(shared_memory.GiveToProcess(base::Process::Current().handle(), |
159 &handle)); | 159 &handle)); |
160 ASSERT_TRUE(channel_->Send(new ViewMsg_Resource_DataReceived( | 160 ASSERT_TRUE(channel_->Send(new ViewMsg_Resource_DataReceived( |
161 message.routing_id(), request_id, handle, body.size()))); | 161 message.routing_id(), request_id, handle, body.size()))); |
162 | 162 |
163 ASSERT_TRUE(channel_->Send(new ViewMsg_Resource_RequestComplete( | 163 ASSERT_TRUE(channel_->Send(new ViewMsg_Resource_RequestComplete( |
164 message.routing_id(), | 164 message.routing_id(), |
165 request_id, | 165 request_id, |
166 URLRequestStatus(), | 166 net::URLRequestStatus(), |
167 std::string(), | 167 std::string(), |
168 base::Time()))); | 168 base::Time()))); |
169 } | 169 } |
170 | 170 |
171 void RenderViewFakeResourcesTest::OnRenderViewReady() { | 171 void RenderViewFakeResourcesTest::OnRenderViewReady() { |
172 // Grab a pointer to the new view using RenderViewVisitor. | 172 // Grab a pointer to the new view using RenderViewVisitor. |
173 ASSERT_TRUE(!view_); | 173 ASSERT_TRUE(!view_); |
174 RenderView::ForEach(this); | 174 RenderView::ForEach(this); |
175 ASSERT_TRUE(view_); | 175 ASSERT_TRUE(view_); |
176 message_loop_.Quit(); | 176 message_loop_.Quit(); |
177 } | 177 } |
178 | 178 |
179 } // namespace safe_browsing | 179 } // namespace safe_browsing |
OLD | NEW |