| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 #ifndef NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 5 #ifndef NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
| 6 #define NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 6 #define NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
| 7 | 7 |
| 8 #include "net/http/http_transaction.h" | 8 #include "net/http/http_transaction.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 return net::ERR_IO_PENDING; | 284 return net::ERR_IO_PENDING; |
| 285 } | 285 } |
| 286 | 286 |
| 287 virtual void StopCaching() {} | 287 virtual void StopCaching() {} |
| 288 | 288 |
| 289 virtual const net::HttpResponseInfo* GetResponseInfo() const { | 289 virtual const net::HttpResponseInfo* GetResponseInfo() const { |
| 290 return &response_; | 290 return &response_; |
| 291 } | 291 } |
| 292 | 292 |
| 293 virtual net::LoadState GetLoadState() const { | 293 virtual net::LoadState GetLoadState() const { |
| 294 NOTREACHED() << "define some mock state transitions"; | 294 if (data_cursor_) |
| 295 return net::LOAD_STATE_READING_RESPONSE; |
| 295 return net::LOAD_STATE_IDLE; | 296 return net::LOAD_STATE_IDLE; |
| 296 } | 297 } |
| 297 | 298 |
| 298 virtual uint64 GetUploadProgress() const { | 299 virtual uint64 GetUploadProgress() const { |
| 299 return 0; | 300 return 0; |
| 300 } | 301 } |
| 301 | 302 |
| 302 private: | 303 private: |
| 303 void CallbackLater(net::CompletionCallback* callback, int result) { | 304 void CallbackLater(net::CompletionCallback* callback, int result) { |
| 304 MessageLoop::current()->PostTask(FROM_HERE, task_factory_.NewRunnableMethod( | 305 MessageLoop::current()->PostTask(FROM_HERE, task_factory_.NewRunnableMethod( |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 }; | 344 }; |
| 344 | 345 |
| 345 | 346 |
| 346 //----------------------------------------------------------------------------- | 347 //----------------------------------------------------------------------------- |
| 347 // helpers | 348 // helpers |
| 348 | 349 |
| 349 // read the transaction completely | 350 // read the transaction completely |
| 350 int ReadTransaction(net::HttpTransaction* trans, std::string* result); | 351 int ReadTransaction(net::HttpTransaction* trans, std::string* result); |
| 351 | 352 |
| 352 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 353 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
| OLD | NEW |