| 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 if (data_cursor_) | 294 NOTREACHED() << "define some mock state transitions"; |
| 295 return net::LOAD_STATE_READING_RESPONSE; | |
| 296 return net::LOAD_STATE_IDLE; | 295 return net::LOAD_STATE_IDLE; |
| 297 } | 296 } |
| 298 | 297 |
| 299 virtual uint64 GetUploadProgress() const { | 298 virtual uint64 GetUploadProgress() const { |
| 300 return 0; | 299 return 0; |
| 301 } | 300 } |
| 302 | 301 |
| 303 private: | 302 private: |
| 304 void CallbackLater(net::CompletionCallback* callback, int result) { | 303 void CallbackLater(net::CompletionCallback* callback, int result) { |
| 305 MessageLoop::current()->PostTask(FROM_HERE, task_factory_.NewRunnableMethod( | 304 MessageLoop::current()->PostTask(FROM_HERE, task_factory_.NewRunnableMethod( |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 }; | 343 }; |
| 345 | 344 |
| 346 | 345 |
| 347 //----------------------------------------------------------------------------- | 346 //----------------------------------------------------------------------------- |
| 348 // helpers | 347 // helpers |
| 349 | 348 |
| 350 // read the transaction completely | 349 // read the transaction completely |
| 351 int ReadTransaction(net::HttpTransaction* trans, std::string* result); | 350 int ReadTransaction(net::HttpTransaction* trans, std::string* result); |
| 352 | 351 |
| 353 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 352 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
| OLD | NEW |