| Index: net/http/http_transaction_unittest.h
|
| diff --git a/net/http/http_transaction_unittest.h b/net/http/http_transaction_unittest.h
|
| index f1bd78ce124435f0fb7ade64db8bb52250842951..cb1e5fab904249cf90deb6128832838de0193fed 100644
|
| --- a/net/http/http_transaction_unittest.h
|
| +++ b/net/http/http_transaction_unittest.h
|
| @@ -189,6 +189,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);
|
| @@ -198,6 +202,7 @@ class MockNetworkTransaction : public net::HttpTransaction {
|
| std::string data_;
|
| int data_cursor_;
|
| int test_mode_;
|
| + net::RequestPriority priority_;
|
| base::WeakPtr<MockNetworkLayer> transaction_factory_;
|
| };
|
|
|
| @@ -211,6 +216,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(
|
| scoped_ptr<net::HttpTransaction>* trans,
|
| @@ -221,6 +239,7 @@ class MockNetworkLayer : public net::HttpTransactionFactory,
|
| private:
|
| int transaction_count_;
|
| bool done_reading_called_;
|
| + MockNetworkTransaction* last_transaction_;
|
| };
|
|
|
| //-----------------------------------------------------------------------------
|
|
|