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

Unified Diff: net/http/http_pipelined_host_impl_unittest.cc

Issue 8770035: Save pipelining capabilities for the most used hosts between sessions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged Created 9 years 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_pipelined_host_impl.cc ('k') | net/http/http_pipelined_host_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_pipelined_host_impl_unittest.cc
diff --git a/net/http/http_pipelined_host_impl_unittest.cc b/net/http/http_pipelined_host_impl_unittest.cc
index ed7d72266430abe7e79087d5e90b5b17d2531041..3eace82026f29c71992fbdfcfe3079bff04dff39 100644
--- a/net/http/http_pipelined_host_impl_unittest.cc
+++ b/net/http/http_pipelined_host_impl_unittest.cc
@@ -32,7 +32,7 @@ class MockHostDelegate : public HttpPipelinedHost::Delegate {
MOCK_METHOD1(OnHostHasAdditionalCapacity, void(HttpPipelinedHost* host));
MOCK_METHOD2(OnHostDeterminedCapability,
void(HttpPipelinedHost* host,
- HttpPipelinedHost::Capability capability));
+ HttpPipelinedHostCapability capability));
};
class MockPipelineFactory : public HttpPipelinedConnection::Factory {
@@ -83,10 +83,10 @@ class HttpPipelinedHostImplTest : public testing::Test {
: origin_("host", 123),
factory_(new MockPipelineFactory), // Owned by host_.
host_(new HttpPipelinedHostImpl(&delegate_, origin_, factory_,
- HttpPipelinedHost::CAPABLE)) {
+ PIPELINE_CAPABLE)) {
}
- void SetCapability(HttpPipelinedHost::Capability capability) {
+ void SetCapability(HttpPipelinedHostCapability capability) {
factory_ = new MockPipelineFactory;
host_.reset(new HttpPipelinedHostImpl(
&delegate_, origin_, factory_, capability));
@@ -200,7 +200,7 @@ TEST_F(HttpPipelinedHostImplTest, PicksLeastLoadedPipeline) {
}
TEST_F(HttpPipelinedHostImplTest, OpensUpOnPipelineSuccess) {
- SetCapability(HttpPipelinedHost::UNKNOWN);
+ SetCapability(PIPELINE_UNKNOWN);
MockPipeline* pipeline = AddTestPipeline(1, true, true);
EXPECT_EQ(NULL, host_->CreateStreamOnExistingPipeline());
@@ -219,7 +219,7 @@ TEST_F(HttpPipelinedHostImplTest, OpensUpOnPipelineSuccess) {
}
TEST_F(HttpPipelinedHostImplTest, OpensAllPipelinesOnPipelineSuccess) {
- SetCapability(HttpPipelinedHost::UNKNOWN);
+ SetCapability(PIPELINE_UNKNOWN);
MockPipeline* pipeline1 = AddTestPipeline(1, false, true);
MockPipeline* pipeline2 = AddTestPipeline(1, true, true);
@@ -240,15 +240,14 @@ TEST_F(HttpPipelinedHostImplTest, OpensAllPipelinesOnPipelineSuccess) {
}
TEST_F(HttpPipelinedHostImplTest, ShutsDownOnOldVersion) {
- SetCapability(HttpPipelinedHost::UNKNOWN);
+ SetCapability(PIPELINE_UNKNOWN);
MockPipeline* pipeline = AddTestPipeline(1, true, true);
EXPECT_EQ(NULL, host_->CreateStreamOnExistingPipeline());
EXPECT_CALL(delegate_, OnHostHasAdditionalCapacity(host_.get()))
.Times(0);
EXPECT_CALL(delegate_,
- OnHostDeterminedCapability(host_.get(),
- HttpPipelinedHost::INCAPABLE))
+ OnHostDeterminedCapability(host_.get(), PIPELINE_INCAPABLE))
.Times(1);
host_->OnPipelineFeedback(pipeline,
HttpPipelinedConnection::OLD_HTTP_VERSION);
@@ -259,7 +258,7 @@ TEST_F(HttpPipelinedHostImplTest, ShutsDownOnOldVersion) {
}
TEST_F(HttpPipelinedHostImplTest, ConnectionCloseHasNoEffect) {
- SetCapability(HttpPipelinedHost::UNKNOWN);
+ SetCapability(PIPELINE_UNKNOWN);
MockPipeline* pipeline = AddTestPipeline(1, true, true);
EXPECT_CALL(delegate_, OnHostHasAdditionalCapacity(host_.get()))
@@ -276,14 +275,13 @@ TEST_F(HttpPipelinedHostImplTest, ConnectionCloseHasNoEffect) {
}
TEST_F(HttpPipelinedHostImplTest, SuccessesLeadToCapable) {
- SetCapability(HttpPipelinedHost::UNKNOWN);
+ SetCapability(PIPELINE_UNKNOWN);
MockPipeline* pipeline = AddTestPipeline(1, true, true);
EXPECT_CALL(delegate_, OnHostHasAdditionalCapacity(host_.get()))
.Times(1);
EXPECT_CALL(delegate_,
- OnHostDeterminedCapability(host_.get(),
- HttpPipelinedHost::CAPABLE))
+ OnHostDeterminedCapability(host_.get(), PIPELINE_CAPABLE))
.Times(1);
host_->OnPipelineFeedback(pipeline, HttpPipelinedConnection::OK);
« no previous file with comments | « net/http/http_pipelined_host_impl.cc ('k') | net/http/http_pipelined_host_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698