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

Unified Diff: net/spdy/spdy_session_spdy2_unittest.cc

Issue 9802003: SPDY - persist SPDY settings. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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/spdy/spdy_session_spdy2_unittest.cc
===================================================================
--- net/spdy/spdy_session_spdy2_unittest.cc (revision 127896)
+++ net/spdy/spdy_session_spdy2_unittest.cc (working copy)
@@ -538,11 +538,10 @@
// Initialize the SpdySettingsStorage with 1 max concurrent streams.
SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool());
- spdy::SpdySettings old_settings;
- spdy::SettingsFlagsAndId id1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, id.id());
- old_settings.push_back(spdy::SpdySetting(id1, 1));
- spdy_session_pool->http_server_properties()->SetSpdySettings(
- test_host_port_pair, old_settings);
+ spdy::SettingsFlagsAndValue flags_and_value1(
+ spdy::SETTINGS_FLAG_PLEASE_PERSIST, 1);
+ spdy_session_pool->http_server_properties()->SetSpdySetting(
+ test_host_port_pair, id.id(), flags_and_value1);
// Create a session.
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
@@ -621,12 +620,12 @@
// Initialize the SpdySettingsStorage with 1 max concurrent streams.
SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool());
- spdy::SpdySettings settings;
- spdy::SettingsFlagsAndId id(spdy::SETTINGS_FLAG_PLEASE_PERSIST,
- spdy::SETTINGS_MAX_CONCURRENT_STREAMS);
- settings.push_back(spdy::SpdySetting(id, 1));
- spdy_session_pool->http_server_properties()->SetSpdySettings(
- test_host_port_pair, settings);
+ spdy::SettingsFlagsAndValue flags_and_value1(
+ spdy::SETTINGS_FLAG_PLEASE_PERSIST, 1);
+ spdy_session_pool->http_server_properties()->SetSpdySetting(
+ test_host_port_pair,
+ spdy::SETTINGS_MAX_CONCURRENT_STREAMS,
+ flags_and_value1);
// Create a session.
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
@@ -720,12 +719,12 @@
HostPortPair test_host_port_pair(kTestHost, kTestPort);
HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct());
- spdy::SettingsFlagsAndId id1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, id.id());
- settings.clear();
- settings.push_back(spdy::SpdySetting(id1, kBogusSettingValue));
+ spdy::SettingsFlagsAndValue flags_and_value1(
+ spdy::SETTINGS_FLAG_PLEASE_PERSIST, kBogusSettingValue);
SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool());
- spdy_session_pool->http_server_properties()->SetSpdySettings(
- test_host_port_pair, settings);
+ spdy_session_pool->http_server_properties()->SetSpdySetting(
+ test_host_port_pair, id.id(), flags_and_value1);
+
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
scoped_refptr<SpdySession> session =
spdy_session_pool->Get(pair, BoundNetLog());
@@ -922,14 +921,12 @@
HttpServerProperties* test_http_server_properties =
spdy_session_pool->http_server_properties();
- spdy::SettingsFlagsAndId id(spdy::SETTINGS_FLAG_PLEASE_PERSIST,
- spdy::SETTINGS_MAX_CONCURRENT_STREAMS);
- const size_t max_concurrent_streams = 2;
- spdy::SpdySettings test_settings;
- test_settings.push_back(spdy::SpdySetting(id, max_concurrent_streams));
-
- test_http_server_properties->SetSpdySettings(test_host_port_pair,
- test_settings);
+ spdy::SettingsFlagsAndValue flags_and_value1(
+ spdy::SETTINGS_FLAG_PLEASE_PERSIST, 2);
+ test_http_server_properties->SetSpdySetting(
+ test_host_port_pair,
+ spdy::SETTINGS_MAX_CONCURRENT_STREAMS,
+ flags_and_value1);
EXPECT_NE(0u, test_http_server_properties->GetSpdySettings(
test_host_port_pair).size());
spdy_session_pool->OnIPAddressChanged();

Powered by Google App Engine
This is Rietveld 408576698