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

Unified Diff: net/http/http_server_properties_manager_unittest.cc

Issue 1156513004: HttpServerProperties - Don't persist if ClearAlternativeService is (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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_server_properties_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_server_properties_manager_unittest.cc
diff --git a/net/http/http_server_properties_manager_unittest.cc b/net/http/http_server_properties_manager_unittest.cc
index be17d9a02c162f91663931d166a6d0b92020fa6a..92c3ce56633eb6a9d0c27a874d092c2d426eedb7 100644
--- a/net/http/http_server_properties_manager_unittest.cc
+++ b/net/http/http_server_properties_manager_unittest.cc
@@ -526,6 +526,27 @@ TEST_F(HttpServerPropertiesManagerTest, GetAlternativeService) {
EXPECT_EQ(NPN_SPDY_4, alternative_service.protocol);
}
+TEST_F(HttpServerPropertiesManagerTest, ClearAlternativeService) {
+ ExpectPrefsUpdate();
+ ExpectScheduleUpdatePrefsOnNetworkThread();
+
+ HostPortPair spdy_server_mail("mail.google.com", 80);
+ EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
+ AlternativeService alternative_service(NPN_SPDY_4, "mail.google.com", 443);
+ http_server_props_manager_->SetAlternativeService(spdy_server_mail,
+ alternative_service, 1.0);
+ ExpectScheduleUpdatePrefsOnNetworkThread();
+ http_server_props_manager_->ClearAlternativeService(spdy_server_mail);
+ // ExpectScheduleUpdatePrefsOnNetworkThread() should be called only once.
+ http_server_props_manager_->ClearAlternativeService(spdy_server_mail);
+
+ // Run the task.
+ base::RunLoop().RunUntilIdle();
+ Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
+
+ EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
+}
+
TEST_F(HttpServerPropertiesManagerTest, SupportsQuic) {
ExpectPrefsUpdate();
ExpectScheduleUpdatePrefsOnNetworkThread();
« no previous file with comments | « net/http/http_server_properties_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698