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

Unified Diff: net/http/http_pipelined_host_pool_unittest.cc

Issue 8833003: Revert 113315 (speculative revert for http://crbug.com/106657) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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_pool.cc ('k') | net/http/http_server_properties.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_pipelined_host_pool_unittest.cc
===================================================================
--- net/http/http_pipelined_host_pool_unittest.cc (revision 113337)
+++ net/http/http_pipelined_host_pool_unittest.cc (working copy)
@@ -7,8 +7,6 @@
#include "base/memory/scoped_ptr.h"
#include "net/base/ssl_config_service.h"
#include "net/http/http_pipelined_host.h"
-#include "net/http/http_pipelined_host_capability.h"
-#include "net/http/http_server_properties_impl.h"
#include "net/proxy/proxy_info.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -38,7 +36,7 @@
MOCK_METHOD4(CreateNewHost, HttpPipelinedHost*(
HttpPipelinedHost::Delegate* delegate, const HostPortPair& origin,
HttpPipelinedConnection::Factory* factory,
- HttpPipelinedHostCapability capability));
+ HttpPipelinedHost::Capability capability));
};
class MockHost : public HttpPipelinedHost {
@@ -68,9 +66,7 @@
: origin_("host", 123),
factory_(new MockHostFactory), // Owned by pool_.
host_(new MockHost(origin_)), // Owned by pool_.
- http_server_properties_(new HttpServerPropertiesImpl),
- pool_(new HttpPipelinedHostPool(&delegate_, factory_,
- http_server_properties_.get())),
+ pool_(new HttpPipelinedHostPool(&delegate_, factory_)),
was_npn_negotiated_(false) {
}
@@ -92,7 +88,6 @@
MockPoolDelegate delegate_;
MockHostFactory* factory_;
MockHost* host_;
- scoped_ptr<HttpServerPropertiesImpl> http_server_properties_;
scoped_ptr<HttpPipelinedHostPool> pool_;
const SSLConfig ssl_config_;
@@ -104,7 +99,7 @@
TEST_F(HttpPipelinedHostPoolTest, DefaultUnknown) {
EXPECT_TRUE(pool_->IsHostEligibleForPipelining(origin_));
EXPECT_CALL(*factory_, CreateNewHost(pool_.get(), Ref(origin_), _,
- PIPELINE_UNKNOWN))
+ HttpPipelinedHost::UNKNOWN))
.Times(1)
.WillOnce(Return(host_));
@@ -114,16 +109,16 @@
TEST_F(HttpPipelinedHostPoolTest, RemembersIncapable) {
EXPECT_CALL(*factory_, CreateNewHost(pool_.get(), Ref(origin_), _,
- PIPELINE_UNKNOWN))
+ HttpPipelinedHost::UNKNOWN))
.Times(1)
.WillOnce(Return(host_));
CreateDummyStream();
- pool_->OnHostDeterminedCapability(host_, PIPELINE_INCAPABLE);
+ pool_->OnHostDeterminedCapability(host_, HttpPipelinedHost::INCAPABLE);
pool_->OnHostIdle(host_);
EXPECT_FALSE(pool_->IsHostEligibleForPipelining(origin_));
EXPECT_CALL(*factory_, CreateNewHost(pool_.get(), Ref(origin_), _,
- PIPELINE_INCAPABLE))
+ HttpPipelinedHost::INCAPABLE))
.Times(0);
EXPECT_EQ(NULL,
pool_->CreateStreamOnNewPipeline(origin_, kDummyConnection,
@@ -133,18 +128,18 @@
TEST_F(HttpPipelinedHostPoolTest, RemembersCapable) {
EXPECT_CALL(*factory_, CreateNewHost(pool_.get(), Ref(origin_), _,
- PIPELINE_UNKNOWN))
+ HttpPipelinedHost::UNKNOWN))
.Times(1)
.WillOnce(Return(host_));
CreateDummyStream();
- pool_->OnHostDeterminedCapability(host_, PIPELINE_CAPABLE);
+ pool_->OnHostDeterminedCapability(host_, HttpPipelinedHost::CAPABLE);
pool_->OnHostIdle(host_);
EXPECT_TRUE(pool_->IsHostEligibleForPipelining(origin_));
host_ = new MockHost(origin_);
EXPECT_CALL(*factory_, CreateNewHost(pool_.get(), Ref(origin_), _,
- PIPELINE_CAPABLE))
+ HttpPipelinedHost::CAPABLE))
.Times(1)
.WillOnce(Return(host_));
CreateDummyStream();
@@ -153,21 +148,21 @@
TEST_F(HttpPipelinedHostPoolTest, IncapableIsSticky) {
EXPECT_CALL(*factory_, CreateNewHost(pool_.get(), Ref(origin_), _,
- PIPELINE_UNKNOWN))
+ HttpPipelinedHost::UNKNOWN))
.Times(1)
.WillOnce(Return(host_));
CreateDummyStream();
- pool_->OnHostDeterminedCapability(host_, PIPELINE_CAPABLE);
- pool_->OnHostDeterminedCapability(host_, PIPELINE_INCAPABLE);
- pool_->OnHostDeterminedCapability(host_, PIPELINE_CAPABLE);
+ pool_->OnHostDeterminedCapability(host_, HttpPipelinedHost::CAPABLE);
+ pool_->OnHostDeterminedCapability(host_, HttpPipelinedHost::INCAPABLE);
+ pool_->OnHostDeterminedCapability(host_, HttpPipelinedHost::CAPABLE);
pool_->OnHostIdle(host_);
EXPECT_FALSE(pool_->IsHostEligibleForPipelining(origin_));
}
TEST_F(HttpPipelinedHostPoolTest, RemainsUnknownWithoutFeedback) {
EXPECT_CALL(*factory_, CreateNewHost(pool_.get(), Ref(origin_), _,
- PIPELINE_UNKNOWN))
+ HttpPipelinedHost::UNKNOWN))
.Times(1)
.WillOnce(Return(host_));
@@ -177,7 +172,7 @@
host_ = new MockHost(origin_);
EXPECT_CALL(*factory_, CreateNewHost(pool_.get(), Ref(origin_), _,
- PIPELINE_UNKNOWN))
+ HttpPipelinedHost::UNKNOWN))
.Times(1)
.WillOnce(Return(host_));
@@ -185,14 +180,6 @@
pool_->OnHostIdle(host_);
}
-TEST_F(HttpPipelinedHostPoolTest, PopulatesServerProperties) {
- EXPECT_EQ(PIPELINE_UNKNOWN,
- http_server_properties_->GetPipelineCapability(host_->origin()));
- pool_->OnHostDeterminedCapability(host_, PIPELINE_CAPABLE);
- EXPECT_EQ(PIPELINE_CAPABLE,
- http_server_properties_->GetPipelineCapability(host_->origin()));
-}
-
} // anonymous namespace
} // namespace net
« no previous file with comments | « net/http/http_pipelined_host_pool.cc ('k') | net/http/http_server_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698