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

Unified Diff: net/http/http_transaction_test_util.h

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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_stream_factory_impl_unittest.cc ('k') | net/http/http_transaction_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ce3bb97818626edef3a16e7c840216f7d499b240 100644
--- a/net/http/http_transaction_test_util.h
+++ b/net/http/http_transaction_test_util.h
@@ -291,11 +291,23 @@ class MockNetworkLayer : public net::HttpTransactionFactory,
net::HttpCache* GetCache() override;
net::HttpNetworkSession* GetSession() override;
+ // The caller must guarantee that |clock| will outlive this object.
+ void SetClock(base::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 SetClock.
+ base::Clock* clock_;
+
base::WeakPtr<MockNetworkTransaction> last_transaction_;
};
« no previous file with comments | « net/http/http_stream_factory_impl_unittest.cc ('k') | net/http/http_transaction_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698