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

Side by Side Diff: net/http/http_transaction_unittest.cc

Issue 7043007: Kill URLRequestJobTracker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge. Created 9 years, 7 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
« no previous file with comments | « net/http/http_transaction_unittest.h ('k') | net/net.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "net/http/http_transaction_unittest.h" 5 #include "net/http/http_transaction_unittest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 } 332 }
333 333
334 net::HttpCache* MockNetworkLayer::GetCache() { 334 net::HttpCache* MockNetworkLayer::GetCache() {
335 return NULL; 335 return NULL;
336 } 336 }
337 337
338 net::HttpNetworkSession* MockNetworkLayer::GetSession() { 338 net::HttpNetworkSession* MockNetworkLayer::GetSession() {
339 return NULL; 339 return NULL;
340 } 340 }
341 341
342 void MockNetworkLayer::Suspend(bool suspend) {}
343
344 //----------------------------------------------------------------------------- 342 //-----------------------------------------------------------------------------
345 // helpers 343 // helpers
346 344
347 int ReadTransaction(net::HttpTransaction* trans, std::string* result) { 345 int ReadTransaction(net::HttpTransaction* trans, std::string* result) {
348 int rv; 346 int rv;
349 347
350 TestCompletionCallback callback; 348 TestCompletionCallback callback;
351 349
352 std::string content; 350 std::string content;
353 do { 351 do {
354 scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256)); 352 scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256));
355 rv = trans->Read(buf, 256, &callback); 353 rv = trans->Read(buf, 256, &callback);
356 if (rv == net::ERR_IO_PENDING) 354 if (rv == net::ERR_IO_PENDING)
357 rv = callback.WaitForResult(); 355 rv = callback.WaitForResult();
358 if (rv > 0) { 356 if (rv > 0) {
359 content.append(buf->data(), rv); 357 content.append(buf->data(), rv);
360 } else if (rv < 0) { 358 } else if (rv < 0) {
361 return rv; 359 return rv;
362 } 360 }
363 } while (rv > 0); 361 } while (rv > 0);
364 362
365 result->swap(content); 363 result->swap(content);
366 return net::OK; 364 return net::OK;
367 } 365 }
OLDNEW
« no previous file with comments | « net/http/http_transaction_unittest.h ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698