| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 //----------------------------------------------------------------------------- | 92 //----------------------------------------------------------------------------- |
| 93 // mock http request | 93 // mock http request |
| 94 | 94 |
| 95 class MockHttpRequest : public net::HttpRequestInfo { | 95 class MockHttpRequest : public net::HttpRequestInfo { |
| 96 public: | 96 public: |
| 97 explicit MockHttpRequest(const MockTransaction& t) { | 97 explicit MockHttpRequest(const MockTransaction& t) { |
| 98 url = GURL(t.url); | 98 url = GURL(t.url); |
| 99 method = t.method; | 99 method = t.method; |
| 100 extra_headers = t.request_headers; | 100 extra_headers.AddHeadersFromString(t.request_headers); |
| 101 load_flags = t.load_flags; | 101 load_flags = t.load_flags; |
| 102 } | 102 } |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 //----------------------------------------------------------------------------- | 105 //----------------------------------------------------------------------------- |
| 106 // use this class to test completely consuming a transaction | 106 // use this class to test completely consuming a transaction |
| 107 | 107 |
| 108 class TestTransactionConsumer : public CallbackRunner< Tuple1<int> > { | 108 class TestTransactionConsumer : public CallbackRunner< Tuple1<int> > { |
| 109 public: | 109 public: |
| 110 explicit TestTransactionConsumer(net::HttpTransactionFactory* factory) | 110 explicit TestTransactionConsumer(net::HttpTransactionFactory* factory) |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 }; | 343 }; |
| 344 | 344 |
| 345 | 345 |
| 346 //----------------------------------------------------------------------------- | 346 //----------------------------------------------------------------------------- |
| 347 // helpers | 347 // helpers |
| 348 | 348 |
| 349 // read the transaction completely | 349 // read the transaction completely |
| 350 int ReadTransaction(net::HttpTransaction* trans, std::string* result); | 350 int ReadTransaction(net::HttpTransaction* trans, std::string* result); |
| 351 | 351 |
| 352 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 352 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
| OLD | NEW |