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

Unified Diff: net/http/http_server_properties_manager_unittest.cc

Issue 1158823005: HttpServerProperties - Don't persist if SetServerNetworkStats is called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_http_props
Patch Set: Always update memory cache Created 5 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
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 89f66d0abad25ab89f9a0f5c3a81bfd0e2a23788..23dc4ff0d478ab095ad1264a1dd66224d4418380 100644
--- a/net/http/http_server_properties_manager_unittest.cc
+++ b/net/http/http_server_properties_manager_unittest.cc
@@ -525,7 +525,11 @@ TEST_F(HttpServerPropertiesManagerTest, ServerNetworkStats) {
EXPECT_EQ(NULL, stats);
ServerNetworkStats stats1;
stats1.srtt = base::TimeDelta::FromMicroseconds(10);
- http_server_props_manager_->SetServerNetworkStats(mail_server, stats1);
+ EXPECT_TRUE(
+ http_server_props_manager_->SetServerNetworkStats(mail_server, stats1));
+ // ExpectPrefsUpdate() should be called only once.
+ EXPECT_FALSE(
+ http_server_props_manager_->SetServerNetworkStats(mail_server, stats1));
// Run the task.
base::RunLoop().RunUntilIdle();
@@ -552,7 +556,10 @@ TEST_F(HttpServerPropertiesManagerTest, Clear) {
http_server_props_manager_->SetSupportsQuic(true, actual_address);
ServerNetworkStats stats;
stats.srtt = base::TimeDelta::FromMicroseconds(10);
- http_server_props_manager_->SetServerNetworkStats(spdy_server_mail, stats);
+ EXPECT_TRUE(http_server_props_manager_->SetServerNetworkStats(
+ spdy_server_mail, stats));
+ EXPECT_FALSE(http_server_props_manager_->SetServerNetworkStats(
+ spdy_server_mail, stats));
const SpdySettingsIds id1 = SETTINGS_UPLOAD_BANDWIDTH;
const SpdySettingsFlags flags1 = SETTINGS_FLAG_PLEASE_PERSIST;
@@ -689,7 +696,8 @@ TEST_F(HttpServerPropertiesManagerTest, UpdateCacheWithPrefs) {
// Set ServerNetworkStats.
ServerNetworkStats stats;
stats.srtt = base::TimeDelta::FromInternalValue(42);
- http_server_props_manager_->SetServerNetworkStats(server_mail, stats);
+ EXPECT_TRUE(
+ http_server_props_manager_->SetServerNetworkStats(server_mail, stats));
// Set SupportsQuic.
IPAddressNumber actual_address;
« net/http/http_server_properties_impl.cc ('K') | « 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