summaryrefslogtreecommitdiff
path: root/chromium/net/http/http_server_properties_manager_unittest.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-07-07 11:39:03 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-07-07 10:30:25 +0000
commitb80be2a302fe1e662a4a2b269d7ee8b7875581df (patch)
tree3a6e79ab9bc38ff554f77127b250edde8e476119 /chromium/net/http/http_server_properties_manager_unittest.cc
parent813fbf95af77a531c57a8c497345ad2c61d475b3 (diff)
downloadqtwebengine-chromium-b80be2a302fe1e662a4a2b269d7ee8b7875581df.tar.gz
BASELINE: Update to chromium 44.0.2403.80
Change-Id: Ib190ddcbbb5f312742c16d159bdfe9dbf7360c8a Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'chromium/net/http/http_server_properties_manager_unittest.cc')
-rw-r--r--chromium/net/http/http_server_properties_manager_unittest.cc50
1 files changed, 50 insertions, 0 deletions
diff --git a/chromium/net/http/http_server_properties_manager_unittest.cc b/chromium/net/http/http_server_properties_manager_unittest.cc
index e34e76d19c3..8d390578c93 100644
--- a/chromium/net/http/http_server_properties_manager_unittest.cc
+++ b/chromium/net/http/http_server_properties_manager_unittest.cc
@@ -548,6 +548,52 @@ TEST_F(HttpServerPropertiesManagerTest, ClearAlternativeService) {
EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
}
+TEST_F(HttpServerPropertiesManagerTest, ConfirmAlternativeService) {
+ ExpectPrefsUpdate();
+
+ HostPortPair spdy_server_mail("mail.google.com", 80);
+ EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
+ AlternativeService alternative_service(NPN_SPDY_4, "mail.google.com", 443);
+
+ ExpectScheduleUpdatePrefsOnNetworkThread();
+ http_server_props_manager_->SetAlternativeService(spdy_server_mail,
+ alternative_service, 1.0);
+
+ EXPECT_FALSE(http_server_props_manager_->IsAlternativeServiceBroken(
+ alternative_service));
+ EXPECT_FALSE(http_server_props_manager_->WasAlternativeServiceRecentlyBroken(
+ alternative_service));
+
+ ExpectScheduleUpdatePrefsOnNetworkThread();
+ http_server_props_manager_->MarkAlternativeServiceBroken(alternative_service);
+ EXPECT_TRUE(http_server_props_manager_->IsAlternativeServiceBroken(
+ alternative_service));
+ EXPECT_TRUE(http_server_props_manager_->WasAlternativeServiceRecentlyBroken(
+ alternative_service));
+
+ ExpectScheduleUpdatePrefsOnNetworkThread();
+ http_server_props_manager_->ConfirmAlternativeService(alternative_service);
+ EXPECT_FALSE(http_server_props_manager_->IsAlternativeServiceBroken(
+ alternative_service));
+ EXPECT_FALSE(http_server_props_manager_->WasAlternativeServiceRecentlyBroken(
+ alternative_service));
+ // ExpectScheduleUpdatePrefsOnNetworkThread() should be called only once.
+ http_server_props_manager_->ConfirmAlternativeService(alternative_service);
+ EXPECT_FALSE(http_server_props_manager_->IsAlternativeServiceBroken(
+ alternative_service));
+ EXPECT_FALSE(http_server_props_manager_->WasAlternativeServiceRecentlyBroken(
+ alternative_service));
+
+ // Run the task.
+ base::RunLoop().RunUntilIdle();
+ Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
+
+ EXPECT_FALSE(http_server_props_manager_->IsAlternativeServiceBroken(
+ alternative_service));
+ EXPECT_FALSE(http_server_props_manager_->WasAlternativeServiceRecentlyBroken(
+ alternative_service));
+}
+
TEST_F(HttpServerPropertiesManagerTest, SupportsQuic) {
ExpectPrefsUpdate();
ExpectScheduleUpdatePrefsOnNetworkThread();
@@ -558,6 +604,8 @@ TEST_F(HttpServerPropertiesManagerTest, SupportsQuic) {
IPAddressNumber actual_address;
CHECK(ParseIPLiteralToNumber("127.0.0.1", &actual_address));
http_server_props_manager_->SetSupportsQuic(true, actual_address);
+ // ExpectScheduleUpdatePrefsOnNetworkThread() should be called only once.
+ http_server_props_manager_->SetSupportsQuic(true, actual_address);
// Run the task.
base::RunLoop().RunUntilIdle();
@@ -578,6 +626,8 @@ TEST_F(HttpServerPropertiesManagerTest, ServerNetworkStats) {
ServerNetworkStats stats1;
stats1.srtt = base::TimeDelta::FromMicroseconds(10);
http_server_props_manager_->SetServerNetworkStats(mail_server, stats1);
+ // ExpectScheduleUpdatePrefsOnNetworkThread() should be called only once.
+ http_server_props_manager_->SetServerNetworkStats(mail_server, stats1);
// Run the task.
base::RunLoop().RunUntilIdle();