Chromium Code Reviews| Index: net/http/http_transaction_test_util.h |
| diff --git a/net/http/http_transaction_test_util.h b/net/http/http_transaction_test_util.h |
| index e6e831257e878a8b6d87083229ebab535db5ef7d..cd4a49fc342ee2e3839a4dbc3b68c483fe255747 100644 |
| --- a/net/http/http_transaction_test_util.h |
| +++ b/net/http/http_transaction_test_util.h |
| @@ -291,11 +291,26 @@ class MockNetworkLayer : public net::HttpTransactionFactory, |
| net::HttpCache* GetCache() override; |
| net::HttpNetworkSession* GetSession() override; |
| + // The caller must guarantee that |clock| will outlive this object. |
| + void set_clock(base::Clock* clock) { |
| + DCHECK(!clock_); |
|
rvargas (doing something else)
2015/01/09 02:25:34
Logging doesn't qualify anymore as trivial accesso
jkarlin
2015/01/09 14:03:51
Done.
|
| + clock_ = clock; |
| + } |
| + base::Clock* clock() const { return clock_; } |
| + |
| + // The current time (will use clock_ if it is non NULL). |
| + base::Time Now(); |
| + |
| private: |
| int transaction_count_; |
| bool done_reading_called_; |
| bool stop_caching_called_; |
| net::RequestPriority last_create_transaction_priority_; |
| + |
| + // By default clock_ is NULL but it can be set to a custom clock by test |
| + // frameworks using set_clock. |
| + base::Clock* clock_; |
| + |
| base::WeakPtr<MockNetworkTransaction> last_transaction_; |
| }; |