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

Unified Diff: net/http/http_transaction_unittest.h

Issue 7569027: net: Notify the http job and cache transaction about a filter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_transaction.h ('k') | net/http/http_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_transaction_unittest.h
===================================================================
--- net/http/http_transaction_unittest.h (revision 95711)
+++ net/http/http_transaction_unittest.h (working copy)
@@ -147,13 +147,15 @@
//-----------------------------------------------------------------------------
// mock network layer
+class MockNetworkLayer;
+
// This transaction class inspects the available set of mock transactions to
// find data for the request URL. It supports IO operations that complete
// synchronously or asynchronously to help exercise different code paths in the
// HttpCache implementation.
class MockNetworkTransaction : public net::HttpTransaction {
public:
- MockNetworkTransaction();
+ explicit MockNetworkTransaction(MockNetworkLayer* factory);
virtual ~MockNetworkTransaction();
virtual int Start(const net::HttpRequestInfo* request,
@@ -176,6 +178,8 @@
virtual void StopCaching();
+ virtual void DoneReading();
+
virtual const net::HttpResponseInfo* GetResponseInfo() const;
virtual net::LoadState GetLoadState() const;
@@ -191,14 +195,18 @@
std::string data_;
int data_cursor_;
int test_mode_;
+ base::WeakPtr<MockNetworkLayer> transaction_factory_;
};
-class MockNetworkLayer : public net::HttpTransactionFactory {
+class MockNetworkLayer : public net::HttpTransactionFactory,
+ public base::SupportsWeakPtr<MockNetworkLayer> {
public:
MockNetworkLayer();
virtual ~MockNetworkLayer();
int transaction_count() const { return transaction_count_; }
+ bool done_reading_called() const { return done_reading_called_; }
+ void TransactionDoneReading();
// net::HttpTransactionFactory:
virtual int CreateTransaction(scoped_ptr<net::HttpTransaction>* trans);
@@ -207,6 +215,7 @@
private:
int transaction_count_;
+ bool done_reading_called_;
};
//-----------------------------------------------------------------------------
« no previous file with comments | « net/http/http_transaction.h ('k') | net/http/http_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698