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 "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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 } | 148 } |
149 | 149 |
150 //----------------------------------------------------------------------------- | 150 //----------------------------------------------------------------------------- |
151 | 151 |
152 // static | 152 // static |
153 int TestTransactionConsumer::quit_counter_ = 0; | 153 int TestTransactionConsumer::quit_counter_ = 0; |
154 | 154 |
155 TestTransactionConsumer::TestTransactionConsumer( | 155 TestTransactionConsumer::TestTransactionConsumer( |
156 net::RequestPriority priority, | 156 net::RequestPriority priority, |
157 net::HttpTransactionFactory* factory) | 157 net::HttpTransactionFactory* factory) |
158 : state_(IDLE), | 158 : state_(IDLE), error_(net::OK) { |
159 trans_(NULL), | |
160 error_(net::OK) { | |
161 // Disregard the error code. | 159 // Disregard the error code. |
162 factory->CreateTransaction(priority, &trans_, NULL); | 160 factory->CreateTransaction(priority, &trans_, NULL); |
163 ++quit_counter_; | 161 ++quit_counter_; |
164 } | 162 } |
165 | 163 |
166 TestTransactionConsumer::~TestTransactionConsumer() { | 164 TestTransactionConsumer::~TestTransactionConsumer() { |
167 } | 165 } |
168 | 166 |
169 void TestTransactionConsumer::Start(const net::HttpRequestInfo* request, | 167 void TestTransactionConsumer::Start(const net::HttpRequestInfo* request, |
170 const net::BoundNetLog& net_log) { | 168 const net::BoundNetLog& net_log) { |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 431 |
434 if (rv > 0) | 432 if (rv > 0) |
435 content.append(buf->data(), rv); | 433 content.append(buf->data(), rv); |
436 else if (rv < 0) | 434 else if (rv < 0) |
437 return rv; | 435 return rv; |
438 } while (rv > 0); | 436 } while (rv > 0); |
439 | 437 |
440 result->swap(content); | 438 result->swap(content); |
441 return net::OK; | 439 return net::OK; |
442 } | 440 } |
OLD | NEW |