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

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

Issue 1604011: Use HttpRequestHeaders for extra_headers. (Closed)
Patch Set: Address eroman comments. Created 10 years, 8 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
« no previous file with comments | « net/http/http_transaction.h ('k') | net/http/http_util.h » ('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) 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
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
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_
OLDNEW
« no previous file with comments | « net/http/http_transaction.h ('k') | net/http/http_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698