Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: chrome/renderer/safe_browsing/render_view_fake_resources_test.cc

Issue 6771043: Enabled actual transfer size in chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "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"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 message.routing_id(), request_id, response_head))); 159 message.routing_id(), request_id, response_head)));
160 160
161 base::SharedMemory shared_memory; 161 base::SharedMemory shared_memory;
162 ASSERT_TRUE(shared_memory.CreateAndMapAnonymous(body.size())); 162 ASSERT_TRUE(shared_memory.CreateAndMapAnonymous(body.size()));
163 memcpy(shared_memory.memory(), body.data(), body.size()); 163 memcpy(shared_memory.memory(), body.data(), body.size());
164 164
165 base::SharedMemoryHandle handle; 165 base::SharedMemoryHandle handle;
166 ASSERT_TRUE(shared_memory.GiveToProcess(base::Process::Current().handle(), 166 ASSERT_TRUE(shared_memory.GiveToProcess(base::Process::Current().handle(),
167 &handle)); 167 &handle));
168 ASSERT_TRUE(channel_->Send(new ResourceMsg_DataReceived( 168 ASSERT_TRUE(channel_->Send(new ResourceMsg_DataReceived(
169 message.routing_id(), request_id, handle, body.size()))); 169 message.routing_id(), request_id, handle, body.size(), body.size())));
170 170
171 ASSERT_TRUE(channel_->Send(new ResourceMsg_RequestComplete( 171 ASSERT_TRUE(channel_->Send(new ResourceMsg_RequestComplete(
172 message.routing_id(), 172 message.routing_id(),
173 request_id, 173 request_id,
174 net::URLRequestStatus(), 174 net::URLRequestStatus(),
175 std::string(), 175 std::string(),
176 base::Time()))); 176 base::Time())));
177 } 177 }
178 178
179 void RenderViewFakeResourcesTest::OnRenderViewReady() { 179 void RenderViewFakeResourcesTest::OnRenderViewReady() {
180 // Grab a pointer to the new view using RenderViewVisitor. 180 // Grab a pointer to the new view using RenderViewVisitor.
181 ASSERT_TRUE(!view_); 181 ASSERT_TRUE(!view_);
182 RenderView::ForEach(this); 182 RenderView::ForEach(this);
183 ASSERT_TRUE(view_); 183 ASSERT_TRUE(view_);
184 message_loop_.Quit(); 184 message_loop_.Quit();
185 } 185 }
186 186
187 } // namespace safe_browsing 187 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698