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

Unified Diff: net/http/http_stream_factory_test_util.h

Issue 1952423002: JobController 2: Remove reference between HttpStreamFactoryImpl::Jobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Job_Controller_1
Patch Set: use unmocked Job::Start() and asyncronous Proxy resolution in tests Created 4 years, 5 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
Index: net/http/http_stream_factory_test_util.h
diff --git a/net/http/http_stream_factory_test_util.h b/net/http/http_stream_factory_test_util.h
index d257b00a5cb416e134f09ea312b8fab15fb7b7e5..0b5e7a6fc1a7229d3568721967be79d4796ed7bd 100644
--- a/net/http/http_stream_factory_test_util.h
+++ b/net/http/http_stream_factory_test_util.h
@@ -14,6 +14,9 @@
#include "net/proxy/proxy_info.h"
#include "testing/gmock/include/gmock/gmock.h"
+using testing::_;
+using testing::Invoke;
+
namespace net {
class HttpStreamFactoryImplPeer {
@@ -115,8 +118,15 @@ class MockHttpStreamFactoryImplJob : public HttpStreamFactoryImpl::Job {
~MockHttpStreamFactoryImplJob() override;
+ void UnmockedStart(HttpStreamRequest::StreamType stream_type) {
+ set_stream_type(stream_type);
+ StartInternal();
+ };
+
MOCK_METHOD1(Start, void(HttpStreamRequest::StreamType stream_type));
+ MOCK_METHOD0(Resume, void());
+
MOCK_METHOD1(MarkOtherJobComplete, void(const Job& job));
MOCK_METHOD0(Orphan, void());
@@ -158,9 +168,19 @@ class TestJobFactory : public HttpStreamFactoryImpl::JobFactory {
return alternative_job_;
}
+ void DisableMockStartForJobs() { disable_mocked_start_ = true; }
+
+ void UseDifferentURLForMainJob(GURL url) {
+ override_main_job_url_ = true;
+ main_job_alternative_url_ = url;
+ }
+
private:
MockHttpStreamFactoryImplJob* main_job_;
MockHttpStreamFactoryImplJob* alternative_job_;
+ bool disable_mocked_start_;
+ bool override_main_job_url_;
+ GURL main_job_alternative_url_;
};
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698