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

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: Comment added 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(),
170 request_id,
171 handle,
172 body.size(),
173 body.size())));
170 174
171 ASSERT_TRUE(channel_->Send(new ResourceMsg_RequestComplete( 175 ASSERT_TRUE(channel_->Send(new ResourceMsg_RequestComplete(
172 message.routing_id(), 176 message.routing_id(),
173 request_id, 177 request_id,
174 net::URLRequestStatus(), 178 net::URLRequestStatus(),
175 std::string(), 179 std::string(),
176 base::Time()))); 180 base::Time())));
177 } 181 }
178 182
179 void RenderViewFakeResourcesTest::OnRenderViewReady() { 183 void RenderViewFakeResourcesTest::OnRenderViewReady() {
180 // Grab a pointer to the new view using RenderViewVisitor. 184 // Grab a pointer to the new view using RenderViewVisitor.
181 ASSERT_TRUE(!view_); 185 ASSERT_TRUE(!view_);
182 RenderView::ForEach(this); 186 RenderView::ForEach(this);
183 ASSERT_TRUE(view_); 187 ASSERT_TRUE(view_);
184 message_loop_.Quit(); 188 message_loop_.Quit();
185 } 189 }
186 190
187 } // namespace safe_browsing 191 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_localization_peer_unittest.cc ('k') | chrome/renderer/security_filter_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698