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 #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 <string> | 10 #include <string> |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 const net::CompletionCallback& callback) OVERRIDE; | 182 const net::CompletionCallback& callback) OVERRIDE; |
183 | 183 |
184 virtual void StopCaching() OVERRIDE; | 184 virtual void StopCaching() OVERRIDE; |
185 | 185 |
186 virtual void DoneReading() OVERRIDE; | 186 virtual void DoneReading() OVERRIDE; |
187 | 187 |
188 virtual const net::HttpResponseInfo* GetResponseInfo() const OVERRIDE; | 188 virtual const net::HttpResponseInfo* GetResponseInfo() const OVERRIDE; |
189 | 189 |
190 virtual net::LoadState GetLoadState() const OVERRIDE; | 190 virtual net::LoadState GetLoadState() const OVERRIDE; |
191 | 191 |
192 virtual uint64 GetUploadProgress() const OVERRIDE; | 192 virtual net::UploadProgress GetUploadProgress() const OVERRIDE; |
193 | 193 |
194 private: | 194 private: |
195 void CallbackLater(const net::CompletionCallback& callback, int result); | 195 void CallbackLater(const net::CompletionCallback& callback, int result); |
196 void RunCallback(const net::CompletionCallback& callback, int result); | 196 void RunCallback(const net::CompletionCallback& callback, int result); |
197 | 197 |
198 base::WeakPtrFactory<MockNetworkTransaction> weak_factory_; | 198 base::WeakPtrFactory<MockNetworkTransaction> weak_factory_; |
199 net::HttpResponseInfo response_; | 199 net::HttpResponseInfo response_; |
200 std::string data_; | 200 std::string data_; |
201 int data_cursor_; | 201 int data_cursor_; |
202 int test_mode_; | 202 int test_mode_; |
(...skipping 22 matching lines...) Expand all Loading... |
225 bool done_reading_called_; | 225 bool done_reading_called_; |
226 }; | 226 }; |
227 | 227 |
228 //----------------------------------------------------------------------------- | 228 //----------------------------------------------------------------------------- |
229 // helpers | 229 // helpers |
230 | 230 |
231 // read the transaction completely | 231 // read the transaction completely |
232 int ReadTransaction(net::HttpTransaction* trans, std::string* result); | 232 int ReadTransaction(net::HttpTransaction* trans, std::string* result); |
233 | 233 |
234 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 234 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
OLD | NEW |