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

Unified Diff: net/spdy/spdy_session_unittest.cc

Issue 7046016: I added a function "void SpdySettingsStorage::Clear()". I added a call to this function "spdy_set... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 7 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_pool.cc ('k') | net/spdy/spdy_settings_storage.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
===================================================================
--- net/spdy/spdy_session_unittest.cc (revision 85710)
+++ net/spdy/spdy_session_unittest.cc (working copy)
@@ -527,6 +527,49 @@
IPPoolingTest(true);
}
+TEST_F(SpdySessionTest, ClearSettingsStorage) {
+ SpdySettingsStorage settings_storage;
+ const std::string kTestHost("www.foo.com");
+ const int kTestPort = 80;
+ HostPortPair test_host_port_pair(kTestHost, kTestPort);
+ spdy::SpdySettings test_settings;
+ spdy::SettingsFlagsAndId id(0);
+ id.set_id(spdy::SETTINGS_MAX_CONCURRENT_STREAMS);
+ id.set_flags(spdy::SETTINGS_FLAG_PLEASE_PERSIST);
+ const size_t max_concurrent_streams = 2;
+ test_settings.push_back(spdy::SpdySetting(id, max_concurrent_streams));
+
+ settings_storage.Set(test_host_port_pair, test_settings);
+ EXPECT_NE(0u, settings_storage.Get(test_host_port_pair).size());
+ settings_storage.Clear();
+ EXPECT_EQ(0u, settings_storage.Get(test_host_port_pair).size());
+}
+
+TEST_F(SpdySessionTest, ClearSettingsStorageOnIPAddressChanged) {
+ const std::string kTestHost("www.foo.com");
+ const int kTestPort = 80;
+ HostPortPair test_host_port_pair(kTestHost, kTestPort);
+
+ SpdySessionDependencies session_deps;
+ scoped_refptr<HttpNetworkSession> http_session(
+ SpdySessionDependencies::SpdyCreateSession(&session_deps));
+ SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool());
+
+ SpdySettingsStorage* test_settings_storage =
+ spdy_session_pool->mutable_spdy_settings();
+ spdy::SettingsFlagsAndId id(0);
+ id.set_id(spdy::SETTINGS_MAX_CONCURRENT_STREAMS);
+ id.set_flags(spdy::SETTINGS_FLAG_PLEASE_PERSIST);
+ const size_t max_concurrent_streams = 2;
+ spdy::SpdySettings test_settings;
+ test_settings.push_back(spdy::SpdySetting(id, max_concurrent_streams));
+
+ test_settings_storage->Set(test_host_port_pair, test_settings);
+ EXPECT_NE(0u, test_settings_storage->Get(test_host_port_pair).size());
+ spdy_session_pool->OnIPAddressChanged();
+ EXPECT_EQ(0u, test_settings_storage->Get(test_host_port_pair).size());
+}
+
} // namespace
} // namespace net
« no previous file with comments | « net/spdy/spdy_session_pool.cc ('k') | net/spdy/spdy_settings_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698