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

Unified Diff: net/spdy/spdy_session_unittest.cc

Issue 1858093002: Alt-Svc 8: Change Supports SPDY list using SHP as the key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@alt_svc_7
Patch Set: server pref changes Created 4 years, 8 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/spdy/spdy_session.cc ('k') | url/scheme_host_port.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session_unittest.cc
diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc
index 91547b4671dfa30f2aee07fe81d0eaf95b3d781b..232efc89a30b93442c1dcd19f2b576b9e7878ba8 100644
--- a/net/spdy/spdy_session_unittest.cc
+++ b/net/spdy/spdy_session_unittest.cc
@@ -136,6 +136,7 @@ class SpdySessionTest : public PlatformTest,
spdy_session_pool_(nullptr),
test_url_(kDefaultURL),
test_host_port_pair_(HostPortPair::FromURL(test_url_)),
+ test_scheme_origin_(test_url_),
key_(test_host_port_pair_,
ProxyServer::Direct(),
PRIVACY_MODE_DISABLED) {
@@ -211,6 +212,7 @@ class SpdySessionTest : public PlatformTest,
SpdySessionPool* spdy_session_pool_;
GURL test_url_;
HostPortPair test_host_port_pair_;
+ url::SchemeHostPort test_scheme_origin_;
SpdySessionKey key_;
BoundTestNetLog log_;
};
@@ -1527,14 +1529,12 @@ TEST_P(SpdySessionTest, ClearSettings) {
// Initialize the SpdySetting with the default.
spdy_session_pool_->http_server_properties()->SetSpdySetting(
- test_host_port_pair_,
- SETTINGS_MAX_CONCURRENT_STREAMS,
- SETTINGS_FLAG_PLEASE_PERSIST,
- kInitialMaxConcurrentStreams);
+ test_scheme_origin_, SETTINGS_MAX_CONCURRENT_STREAMS,
+ SETTINGS_FLAG_PLEASE_PERSIST, kInitialMaxConcurrentStreams);
- EXPECT_FALSE(
- spdy_session_pool_->http_server_properties()->GetSpdySettings(
- test_host_port_pair_).empty());
+ EXPECT_FALSE(spdy_session_pool_->http_server_properties()
+ ->GetSpdySettings(test_scheme_origin_)
+ .empty());
CreateInsecureSpdySession();
@@ -1558,9 +1558,9 @@ TEST_P(SpdySessionTest, ClearSettings) {
EXPECT_EQ(OK, stream_releaser.WaitForResult());
// Make sure that persisted data is cleared.
- EXPECT_TRUE(
- spdy_session_pool_->http_server_properties()->GetSpdySettings(
- test_host_port_pair_).empty());
+ EXPECT_TRUE(spdy_session_pool_->http_server_properties()
+ ->GetSpdySettings(test_scheme_origin_)
+ .empty());
// Make sure session's max_concurrent_streams is correct.
EXPECT_EQ(kInitialMaxConcurrentStreams + 1,
@@ -1590,10 +1590,8 @@ TEST_P(SpdySessionTest, CancelPendingCreateStream) {
// Initialize the SpdySetting with 1 max concurrent streams.
spdy_session_pool_->http_server_properties()->SetSpdySetting(
- test_host_port_pair_,
- SETTINGS_MAX_CONCURRENT_STREAMS,
- SETTINGS_FLAG_PLEASE_PERSIST,
- 1);
+ test_scheme_origin_, SETTINGS_MAX_CONCURRENT_STREAMS,
+ SETTINGS_FLAG_PLEASE_PERSIST, 1);
CreateInsecureSpdySession();
@@ -1668,10 +1666,8 @@ TEST_P(SpdySessionTest, SendInitialDataOnNewSession) {
CreateNetworkSession();
spdy_session_pool_->http_server_properties()->SetSpdySetting(
- test_host_port_pair_,
- SETTINGS_MAX_CONCURRENT_STREAMS,
- SETTINGS_FLAG_PLEASE_PERSIST,
- initial_max_concurrent_streams);
+ test_scheme_origin_, SETTINGS_MAX_CONCURRENT_STREAMS,
+ SETTINGS_FLAG_PLEASE_PERSIST, initial_max_concurrent_streams);
SpdySessionPoolPeer pool_peer(spdy_session_pool_);
pool_peer.SetEnableSendingInitialData(true);
@@ -1688,16 +1684,16 @@ TEST_P(SpdySessionTest, ClearSettingsStorageOnIPAddressChanged) {
base::WeakPtr<HttpServerProperties> test_http_server_properties =
spdy_session_pool_->http_server_properties();
SettingsFlagsAndValue flags_and_value1(SETTINGS_FLAG_PLEASE_PERSIST, 2);
- test_http_server_properties->SetSpdySetting(
- test_host_port_pair_,
- SETTINGS_MAX_CONCURRENT_STREAMS,
- SETTINGS_FLAG_PLEASE_PERSIST,
- 2);
- EXPECT_NE(0u, test_http_server_properties->GetSpdySettings(
- test_host_port_pair_).size());
+ test_http_server_properties->SetSpdySetting(test_scheme_origin_,
+ SETTINGS_MAX_CONCURRENT_STREAMS,
+ SETTINGS_FLAG_PLEASE_PERSIST, 2);
+ EXPECT_NE(
+ 0u,
+ test_http_server_properties->GetSpdySettings(test_scheme_origin_).size());
spdy_session_pool_->OnIPAddressChanged();
- EXPECT_EQ(0u, test_http_server_properties->GetSpdySettings(
- test_host_port_pair_).size());
+ EXPECT_EQ(
+ 0u,
+ test_http_server_properties->GetSpdySettings(test_scheme_origin_).size());
}
TEST_P(SpdySessionTest, Initialize) {
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | url/scheme_host_port.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698