| 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_;
|
| };
|
|
|
| //-----------------------------------------------------------------------------
|
|
|