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

Unified Diff: net/http/http_basic_state_unittest.cc

Issue 2299703003: Re-land: Only allow HTTP/0.9 support on default ports. (Closed)
Patch Set: Fix test Created 4 years, 4 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_basic_state.cc ('k') | net/http/http_basic_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_basic_state_unittest.cc
diff --git a/net/http/http_basic_state_unittest.cc b/net/http/http_basic_state_unittest.cc
index 1d9476da23cafa1e1b114f0373032e5bbd98c1eb..cf0fcde0f7075df761e9461085465f0f3025fbf0 100644
--- a/net/http/http_basic_state_unittest.cc
+++ b/net/http/http_basic_state_unittest.cc
@@ -17,20 +17,25 @@ namespace {
TEST(HttpBasicStateTest, ConstructsProperly) {
ClientSocketHandle* const handle = new ClientSocketHandle;
// Ownership of |handle| is passed to |state|.
- const HttpBasicState state(base::WrapUnique(handle), true);
+ const HttpBasicState state(base::WrapUnique(handle), true /* using_proxy */,
+ false /* http_09_on_non_default_ports_enabled */);
EXPECT_EQ(handle, state.connection());
EXPECT_TRUE(state.using_proxy());
+ EXPECT_FALSE(state.http_09_on_non_default_ports_enabled());
}
-TEST(HttpBasicStateTest, UsingProxyCanBeFalse) {
- const HttpBasicState state(base::MakeUnique<ClientSocketHandle>(), false);
+TEST(HttpBasicStateTest, ConstructsProperlyWithDifferentOptions) {
+ const HttpBasicState state(base::MakeUnique<ClientSocketHandle>(),
+ false /* using_proxy */,
+ true /* http_09_on_non_default_ports_enabled */);
EXPECT_FALSE(state.using_proxy());
+ EXPECT_TRUE(state.http_09_on_non_default_ports_enabled());
}
TEST(HttpBasicStateTest, ReleaseConnectionWorks) {
ClientSocketHandle* const handle = new ClientSocketHandle;
// Ownership of |handle| is passed to |state|.
- HttpBasicState state(base::WrapUnique(handle), false);
+ HttpBasicState state(base::WrapUnique(handle), false, false);
const std::unique_ptr<ClientSocketHandle> released_connection(
state.ReleaseConnection());
EXPECT_EQ(NULL, state.connection());
@@ -38,7 +43,7 @@ TEST(HttpBasicStateTest, ReleaseConnectionWorks) {
}
TEST(HttpBasicStateTest, InitializeWorks) {
- HttpBasicState state(base::MakeUnique<ClientSocketHandle>(), false);
+ HttpBasicState state(base::MakeUnique<ClientSocketHandle>(), false, false);
const HttpRequestInfo request_info;
EXPECT_EQ(OK,
state.Initialize(
@@ -47,7 +52,7 @@ TEST(HttpBasicStateTest, InitializeWorks) {
}
TEST(HttpBasicStateTest, DeleteParser) {
- HttpBasicState state(base::MakeUnique<ClientSocketHandle>(), false);
+ HttpBasicState state(base::MakeUnique<ClientSocketHandle>(), false, false);
const HttpRequestInfo request_info;
state.Initialize(&request_info, LOW, BoundNetLog(), CompletionCallback());
EXPECT_TRUE(state.parser());
@@ -57,7 +62,8 @@ TEST(HttpBasicStateTest, DeleteParser) {
TEST(HttpBasicStateTest, GenerateRequestLineNoProxy) {
const bool use_proxy = false;
- HttpBasicState state(base::MakeUnique<ClientSocketHandle>(), use_proxy);
+ HttpBasicState state(base::MakeUnique<ClientSocketHandle>(), use_proxy,
+ false);
HttpRequestInfo request_info;
request_info.url = GURL("http://www.example.com/path?foo=bar#hoge");
request_info.method = "PUT";
@@ -67,7 +73,8 @@ TEST(HttpBasicStateTest, GenerateRequestLineNoProxy) {
TEST(HttpBasicStateTest, GenerateRequestLineWithProxy) {
const bool use_proxy = true;
- HttpBasicState state(base::MakeUnique<ClientSocketHandle>(), use_proxy);
+ HttpBasicState state(base::MakeUnique<ClientSocketHandle>(), use_proxy,
+ false);
HttpRequestInfo request_info;
request_info.url = GURL("http://www.example.com/path?foo=bar#hoge");
request_info.method = "PUT";
« no previous file with comments | « net/http/http_basic_state.cc ('k') | net/http/http_basic_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698