| Index: net/http/http_transaction_unittest.h
|
| diff --git a/net/http/http_transaction_unittest.h b/net/http/http_transaction_unittest.h
|
| index 693b72089be4c4b695423725b71035eb5c692cb1..844e7f4d4a3f2e862a9cd58975167a70add879aa 100644
|
| --- a/net/http/http_transaction_unittest.h
|
| +++ b/net/http/http_transaction_unittest.h
|
| @@ -192,6 +192,10 @@ class MockNetworkTransaction : public net::HttpTransaction {
|
| virtual bool GetLoadTimingInfo(
|
| net::LoadTimingInfo* load_timing_info) const OVERRIDE;
|
|
|
| + virtual void SetPriority(net::RequestPriority priority) OVERRIDE;
|
| +
|
| + net::RequestPriority priority() const { return priority_; }
|
| +
|
| private:
|
| void CallbackLater(const net::CompletionCallback& callback, int result);
|
| void RunCallback(const net::CompletionCallback& callback, int result);
|
| @@ -201,6 +205,7 @@ class MockNetworkTransaction : public net::HttpTransaction {
|
| std::string data_;
|
| int data_cursor_;
|
| int test_mode_;
|
| + net::RequestPriority priority_;
|
| base::WeakPtr<MockNetworkLayer> transaction_factory_;
|
| };
|
|
|
| @@ -214,6 +219,19 @@ class MockNetworkLayer : public net::HttpTransactionFactory,
|
| bool done_reading_called() const { return done_reading_called_; }
|
| void TransactionDoneReading();
|
|
|
| + // Returns the last transaction created by CreateTransaction, or
|
| + // NULL if one has not been created yet. It is the caller's
|
| + // responsibility to make sure that that transaction is still valid.
|
| + MockNetworkTransaction* last_transaction() {
|
| + return last_transaction_;
|
| + }
|
| +
|
| + // Makes last_transaction() return NULL until the next transaction
|
| + // is created.
|
| + void ClearLastTransaction() {
|
| + last_transaction_ = NULL;
|
| + }
|
| +
|
| // net::HttpTransactionFactory:
|
| virtual int CreateTransaction(
|
| net::RequestPriority priority,
|
| @@ -225,6 +243,7 @@ class MockNetworkLayer : public net::HttpTransactionFactory,
|
| private:
|
| int transaction_count_;
|
| bool done_reading_called_;
|
| + MockNetworkTransaction* last_transaction_;
|
| };
|
|
|
| //-----------------------------------------------------------------------------
|
|
|