| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/http/http_server_properties_manager.h" | 5 #include "net/http/http_server_properties_manager.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 | 407 |
| 408 // Verify alternative service. | 408 // Verify alternative service. |
| 409 if (GetParam() >= 4) { | 409 if (GetParam() >= 4) { |
| 410 const AlternativeServiceMap& map = | 410 const AlternativeServiceMap& map = |
| 411 http_server_props_manager_->alternative_service_map(); | 411 http_server_props_manager_->alternative_service_map(); |
| 412 ASSERT_EQ(2u, map.size()); | 412 ASSERT_EQ(2u, map.size()); |
| 413 | 413 |
| 414 AlternativeServiceMap::const_iterator map_it = map.begin(); | 414 AlternativeServiceMap::const_iterator map_it = map.begin(); |
| 415 EXPECT_EQ("mail.google.com", map_it->first.host()); | 415 EXPECT_EQ("mail.google.com", map_it->first.host()); |
| 416 ASSERT_EQ(1u, map_it->second.size()); | 416 ASSERT_EQ(1u, map_it->second.size()); |
| 417 EXPECT_EQ(kProtoHTTP2, map_it->second[0].alternative_service.protocol); | 417 EXPECT_EQ(kProtoHTTP2, map_it->second[0].alternative_service().protocol); |
| 418 EXPECT_TRUE(map_it->second[0].alternative_service.host.empty()); | 418 EXPECT_TRUE(map_it->second[0].alternative_service().host.empty()); |
| 419 EXPECT_EQ(444, map_it->second[0].alternative_service.port); | 419 EXPECT_EQ(444, map_it->second[0].alternative_service().port); |
| 420 ++map_it; | 420 ++map_it; |
| 421 EXPECT_EQ("www.google.com", map_it->first.host()); | 421 EXPECT_EQ("www.google.com", map_it->first.host()); |
| 422 ASSERT_EQ(2u, map_it->second.size()); | 422 ASSERT_EQ(2u, map_it->second.size()); |
| 423 EXPECT_EQ(kProtoHTTP2, map_it->second[0].alternative_service.protocol); | 423 EXPECT_EQ(kProtoHTTP2, map_it->second[0].alternative_service().protocol); |
| 424 EXPECT_TRUE(map_it->second[0].alternative_service.host.empty()); | 424 EXPECT_TRUE(map_it->second[0].alternative_service().host.empty()); |
| 425 EXPECT_EQ(443, map_it->second[0].alternative_service.port); | 425 EXPECT_EQ(443, map_it->second[0].alternative_service().port); |
| 426 EXPECT_EQ(kProtoQUIC, map_it->second[1].alternative_service.protocol); | 426 EXPECT_EQ(kProtoQUIC, map_it->second[1].alternative_service().protocol); |
| 427 EXPECT_TRUE(map_it->second[1].alternative_service.host.empty()); | 427 EXPECT_TRUE(map_it->second[1].alternative_service().host.empty()); |
| 428 EXPECT_EQ(1234, map_it->second[1].alternative_service.port); | 428 EXPECT_EQ(1234, map_it->second[1].alternative_service().port); |
| 429 } else { | 429 } else { |
| 430 const AlternativeServiceMap& map = | 430 const AlternativeServiceMap& map = |
| 431 http_server_props_manager_->alternative_service_map(); | 431 http_server_props_manager_->alternative_service_map(); |
| 432 ASSERT_EQ(2u, map.size()); | 432 ASSERT_EQ(2u, map.size()); |
| 433 AlternativeServiceMap::const_iterator map_it = map.begin(); | 433 AlternativeServiceMap::const_iterator map_it = map.begin(); |
| 434 EXPECT_EQ("www.google.com", map_it->first.host()); | 434 EXPECT_EQ("www.google.com", map_it->first.host()); |
| 435 ASSERT_EQ(2u, map_it->second.size()); | 435 ASSERT_EQ(2u, map_it->second.size()); |
| 436 EXPECT_EQ(kProtoHTTP2, map_it->second[0].alternative_service.protocol); | 436 EXPECT_EQ(kProtoHTTP2, map_it->second[0].alternative_service().protocol); |
| 437 EXPECT_TRUE(map_it->second[0].alternative_service.host.empty()); | 437 EXPECT_TRUE(map_it->second[0].alternative_service().host.empty()); |
| 438 EXPECT_EQ(443, map_it->second[0].alternative_service.port); | 438 EXPECT_EQ(443, map_it->second[0].alternative_service().port); |
| 439 EXPECT_EQ(kProtoQUIC, map_it->second[1].alternative_service.protocol); | 439 EXPECT_EQ(kProtoQUIC, map_it->second[1].alternative_service().protocol); |
| 440 EXPECT_TRUE(map_it->second[1].alternative_service.host.empty()); | 440 EXPECT_TRUE(map_it->second[1].alternative_service().host.empty()); |
| 441 EXPECT_EQ(1234, map_it->second[1].alternative_service.port); | 441 EXPECT_EQ(1234, map_it->second[1].alternative_service().port); |
| 442 ++map_it; | 442 ++map_it; |
| 443 EXPECT_EQ("mail.google.com", map_it->first.host()); | 443 EXPECT_EQ("mail.google.com", map_it->first.host()); |
| 444 ASSERT_EQ(1u, map_it->second.size()); | 444 ASSERT_EQ(1u, map_it->second.size()); |
| 445 EXPECT_EQ(kProtoHTTP2, map_it->second[0].alternative_service.protocol); | 445 EXPECT_EQ(kProtoHTTP2, map_it->second[0].alternative_service().protocol); |
| 446 EXPECT_TRUE(map_it->second[0].alternative_service.host.empty()); | 446 EXPECT_TRUE(map_it->second[0].alternative_service().host.empty()); |
| 447 EXPECT_EQ(444, map_it->second[0].alternative_service.port); | 447 EXPECT_EQ(444, map_it->second[0].alternative_service().port); |
| 448 } | 448 } |
| 449 | 449 |
| 450 // Verify SupportsQuic. | 450 // Verify SupportsQuic. |
| 451 IPAddress last_address; | 451 IPAddress last_address; |
| 452 EXPECT_TRUE(http_server_props_manager_->GetSupportsQuic(&last_address)); | 452 EXPECT_TRUE(http_server_props_manager_->GetSupportsQuic(&last_address)); |
| 453 EXPECT_EQ("127.0.0.1", last_address.ToString()); | 453 EXPECT_EQ("127.0.0.1", last_address.ToString()); |
| 454 | 454 |
| 455 // Verify ServerNetworkStats. | 455 // Verify ServerNetworkStats. |
| 456 const ServerNetworkStats* stats2 = | 456 const ServerNetworkStats* stats2 = |
| 457 http_server_props_manager_->GetServerNetworkStats(google_server); | 457 http_server_props_manager_->GetServerNetworkStats(google_server); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 EXPECT_FALSE(net_test_task_runner_->HasPendingTask()); | 742 EXPECT_FALSE(net_test_task_runner_->HasPendingTask()); |
| 743 pref_test_task_runner_->FastForwardUntilNoTasksRemain(); | 743 pref_test_task_runner_->FastForwardUntilNoTasksRemain(); |
| 744 EXPECT_FALSE(pref_test_task_runner_->HasPendingTask()); | 744 EXPECT_FALSE(pref_test_task_runner_->HasPendingTask()); |
| 745 EXPECT_FALSE(net_test_task_runner_->HasPendingTask()); | 745 EXPECT_FALSE(net_test_task_runner_->HasPendingTask()); |
| 746 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); | 746 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); |
| 747 | 747 |
| 748 AlternativeServiceInfoVector alternative_service_info_vector = | 748 AlternativeServiceInfoVector alternative_service_info_vector = |
| 749 http_server_props_manager_->GetAlternativeServiceInfos(spdy_server_mail); | 749 http_server_props_manager_->GetAlternativeServiceInfos(spdy_server_mail); |
| 750 ASSERT_EQ(1u, alternative_service_info_vector.size()); | 750 ASSERT_EQ(1u, alternative_service_info_vector.size()); |
| 751 EXPECT_EQ(alternative_service, | 751 EXPECT_EQ(alternative_service, |
| 752 alternative_service_info_vector[0].alternative_service); | 752 alternative_service_info_vector[0].alternative_service()); |
| 753 } | 753 } |
| 754 | 754 |
| 755 TEST_P(HttpServerPropertiesManagerTest, SetAlternativeServices) { | 755 TEST_P(HttpServerPropertiesManagerTest, SetAlternativeServices) { |
| 756 ExpectPrefsUpdate(1); | 756 ExpectPrefsUpdate(1); |
| 757 ExpectScheduleUpdatePrefsOnNetworkSequence(); | 757 ExpectScheduleUpdatePrefsOnNetworkSequence(); |
| 758 | 758 |
| 759 url::SchemeHostPort spdy_server_mail("http", "mail.google.com", 80); | 759 url::SchemeHostPort spdy_server_mail("http", "mail.google.com", 80); |
| 760 EXPECT_FALSE(HasAlternativeService(spdy_server_mail)); | 760 EXPECT_FALSE(HasAlternativeService(spdy_server_mail)); |
| 761 AlternativeServiceInfoVector alternative_service_info_vector; | 761 AlternativeServiceInfoVector alternative_service_info_vector; |
| 762 const AlternativeService alternative_service1(kProtoHTTP2, "mail.google.com", | 762 const AlternativeService alternative_service1(kProtoHTTP2, "mail.google.com", |
| (...skipping 18 matching lines...) Expand all Loading... |
| 781 EXPECT_FALSE(net_test_task_runner_->HasPendingTask()); | 781 EXPECT_FALSE(net_test_task_runner_->HasPendingTask()); |
| 782 pref_test_task_runner_->FastForwardUntilNoTasksRemain(); | 782 pref_test_task_runner_->FastForwardUntilNoTasksRemain(); |
| 783 EXPECT_FALSE(pref_test_task_runner_->HasPendingTask()); | 783 EXPECT_FALSE(pref_test_task_runner_->HasPendingTask()); |
| 784 EXPECT_FALSE(net_test_task_runner_->HasPendingTask()); | 784 EXPECT_FALSE(net_test_task_runner_->HasPendingTask()); |
| 785 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); | 785 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); |
| 786 | 786 |
| 787 AlternativeServiceInfoVector alternative_service_info_vector2 = | 787 AlternativeServiceInfoVector alternative_service_info_vector2 = |
| 788 http_server_props_manager_->GetAlternativeServiceInfos(spdy_server_mail); | 788 http_server_props_manager_->GetAlternativeServiceInfos(spdy_server_mail); |
| 789 ASSERT_EQ(2u, alternative_service_info_vector2.size()); | 789 ASSERT_EQ(2u, alternative_service_info_vector2.size()); |
| 790 EXPECT_EQ(alternative_service1, | 790 EXPECT_EQ(alternative_service1, |
| 791 alternative_service_info_vector2[0].alternative_service); | 791 alternative_service_info_vector2[0].alternative_service()); |
| 792 EXPECT_EQ(alternative_service2, | 792 EXPECT_EQ(alternative_service2, |
| 793 alternative_service_info_vector2[1].alternative_service); | 793 alternative_service_info_vector2[1].alternative_service()); |
| 794 } | 794 } |
| 795 | 795 |
| 796 TEST_P(HttpServerPropertiesManagerTest, SetAlternativeServicesEmpty) { | 796 TEST_P(HttpServerPropertiesManagerTest, SetAlternativeServicesEmpty) { |
| 797 url::SchemeHostPort spdy_server_mail("http", "mail.google.com", 80); | 797 url::SchemeHostPort spdy_server_mail("http", "mail.google.com", 80); |
| 798 EXPECT_FALSE(HasAlternativeService(spdy_server_mail)); | 798 EXPECT_FALSE(HasAlternativeService(spdy_server_mail)); |
| 799 const AlternativeService alternative_service(kProtoHTTP2, "mail.google.com", | 799 const AlternativeService alternative_service(kProtoHTTP2, "mail.google.com", |
| 800 443); | 800 443); |
| 801 http_server_props_manager_->SetAlternativeServices( | 801 http_server_props_manager_->SetAlternativeServices( |
| 802 spdy_server_mail, AlternativeServiceInfoVector()); | 802 spdy_server_mail, AlternativeServiceInfoVector()); |
| 803 | 803 |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1138 GURL server_gurl; | 1138 GURL server_gurl; |
| 1139 if (GetParam() >= 5) { | 1139 if (GetParam() >= 5) { |
| 1140 server_gurl = GURL(StringPrintf("https://www.google.com:%d", i)); | 1140 server_gurl = GURL(StringPrintf("https://www.google.com:%d", i)); |
| 1141 } else { | 1141 } else { |
| 1142 server_gurl = GURL(StringPrintf("https://www.google.com:%d", i)); | 1142 server_gurl = GURL(StringPrintf("https://www.google.com:%d", i)); |
| 1143 } | 1143 } |
| 1144 url::SchemeHostPort server(server_gurl); | 1144 url::SchemeHostPort server(server_gurl); |
| 1145 AlternativeServiceInfoVector alternative_service_info_vector = | 1145 AlternativeServiceInfoVector alternative_service_info_vector = |
| 1146 http_server_props_manager_->GetAlternativeServiceInfos(server); | 1146 http_server_props_manager_->GetAlternativeServiceInfos(server); |
| 1147 ASSERT_EQ(1u, alternative_service_info_vector.size()); | 1147 ASSERT_EQ(1u, alternative_service_info_vector.size()); |
| 1148 EXPECT_EQ(kProtoQUIC, | 1148 EXPECT_EQ( |
| 1149 alternative_service_info_vector[0].alternative_service.protocol); | 1149 kProtoQUIC, |
| 1150 EXPECT_EQ(i, alternative_service_info_vector[0].alternative_service.port); | 1150 alternative_service_info_vector[0].alternative_service().protocol); |
| 1151 EXPECT_EQ(i, alternative_service_info_vector[0].alternative_service().port); |
| 1151 } | 1152 } |
| 1152 | 1153 |
| 1153 // Verify SupportsQuic. | 1154 // Verify SupportsQuic. |
| 1154 IPAddress address; | 1155 IPAddress address; |
| 1155 ASSERT_TRUE(http_server_props_manager_->GetSupportsQuic(&address)); | 1156 ASSERT_TRUE(http_server_props_manager_->GetSupportsQuic(&address)); |
| 1156 EXPECT_EQ("127.0.0.1", address.ToString()); | 1157 EXPECT_EQ("127.0.0.1", address.ToString()); |
| 1157 } | 1158 } |
| 1158 | 1159 |
| 1159 TEST_P(HttpServerPropertiesManagerTest, UpdatePrefsWithCache) { | 1160 TEST_P(HttpServerPropertiesManagerTest, UpdatePrefsWithCache) { |
| 1160 ExpectScheduleUpdatePrefsOnNetworkSequenceRepeatedly(5); | 1161 ExpectScheduleUpdatePrefsOnNetworkSequenceRepeatedly(5); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 AlternativeServiceMap alternative_service_map(/*max_size=*/5); | 1288 AlternativeServiceMap alternative_service_map(/*max_size=*/5); |
| 1288 EXPECT_TRUE(http_server_props_manager_->AddToAlternativeServiceMap( | 1289 EXPECT_TRUE(http_server_props_manager_->AddToAlternativeServiceMap( |
| 1289 server, *server_dict, &alternative_service_map)); | 1290 server, *server_dict, &alternative_service_map)); |
| 1290 | 1291 |
| 1291 AlternativeServiceMap::iterator it = alternative_service_map.Get(server); | 1292 AlternativeServiceMap::iterator it = alternative_service_map.Get(server); |
| 1292 ASSERT_NE(alternative_service_map.end(), it); | 1293 ASSERT_NE(alternative_service_map.end(), it); |
| 1293 AlternativeServiceInfoVector alternative_service_info_vector = it->second; | 1294 AlternativeServiceInfoVector alternative_service_info_vector = it->second; |
| 1294 ASSERT_EQ(3u, alternative_service_info_vector.size()); | 1295 ASSERT_EQ(3u, alternative_service_info_vector.size()); |
| 1295 | 1296 |
| 1296 EXPECT_EQ(kProtoHTTP2, | 1297 EXPECT_EQ(kProtoHTTP2, |
| 1297 alternative_service_info_vector[0].alternative_service.protocol); | 1298 alternative_service_info_vector[0].alternative_service().protocol); |
| 1298 EXPECT_EQ("", alternative_service_info_vector[0].alternative_service.host); | 1299 EXPECT_EQ("", alternative_service_info_vector[0].alternative_service().host); |
| 1299 EXPECT_EQ(443, alternative_service_info_vector[0].alternative_service.port); | 1300 EXPECT_EQ(443, alternative_service_info_vector[0].alternative_service().port); |
| 1300 // Expiration defaults to one day from now, testing with tolerance. | 1301 // Expiration defaults to one day from now, testing with tolerance. |
| 1301 const base::Time now = base::Time::Now(); | 1302 const base::Time now = base::Time::Now(); |
| 1302 const base::Time expiration = alternative_service_info_vector[0].expiration; | 1303 const base::Time expiration = alternative_service_info_vector[0].expiration(); |
| 1303 EXPECT_LE(now + base::TimeDelta::FromHours(23), expiration); | 1304 EXPECT_LE(now + base::TimeDelta::FromHours(23), expiration); |
| 1304 EXPECT_GE(now + base::TimeDelta::FromDays(1), expiration); | 1305 EXPECT_GE(now + base::TimeDelta::FromDays(1), expiration); |
| 1305 | 1306 |
| 1306 EXPECT_EQ(kProtoQUIC, | 1307 EXPECT_EQ(kProtoQUIC, |
| 1307 alternative_service_info_vector[1].alternative_service.protocol); | 1308 alternative_service_info_vector[1].alternative_service().protocol); |
| 1308 EXPECT_EQ("", alternative_service_info_vector[1].alternative_service.host); | 1309 EXPECT_EQ("", alternative_service_info_vector[1].alternative_service().host); |
| 1309 EXPECT_EQ(123, alternative_service_info_vector[1].alternative_service.port); | 1310 EXPECT_EQ(123, alternative_service_info_vector[1].alternative_service().port); |
| 1310 // numeric_limits<int64_t>::max() represents base::Time::Max(). | 1311 // numeric_limits<int64_t>::max() represents base::Time::Max(). |
| 1311 EXPECT_EQ(base::Time::Max(), alternative_service_info_vector[1].expiration); | 1312 EXPECT_EQ(base::Time::Max(), alternative_service_info_vector[1].expiration()); |
| 1312 | 1313 |
| 1313 EXPECT_EQ(kProtoHTTP2, | 1314 EXPECT_EQ(kProtoHTTP2, |
| 1314 alternative_service_info_vector[2].alternative_service.protocol); | 1315 alternative_service_info_vector[2].alternative_service().protocol); |
| 1315 EXPECT_EQ("example.org", | 1316 EXPECT_EQ("example.org", |
| 1316 alternative_service_info_vector[2].alternative_service.host); | 1317 alternative_service_info_vector[2].alternative_service().host); |
| 1317 EXPECT_EQ(1234, alternative_service_info_vector[2].alternative_service.port); | 1318 EXPECT_EQ(1234, |
| 1319 alternative_service_info_vector[2].alternative_service().port); |
| 1318 base::Time expected_expiration; | 1320 base::Time expected_expiration; |
| 1319 ASSERT_TRUE( | 1321 ASSERT_TRUE( |
| 1320 base::Time::FromUTCString("2036-12-31 10:00:00", &expected_expiration)); | 1322 base::Time::FromUTCString("2036-12-31 10:00:00", &expected_expiration)); |
| 1321 EXPECT_EQ(expected_expiration, alternative_service_info_vector[2].expiration); | 1323 EXPECT_EQ(expected_expiration, |
| 1324 alternative_service_info_vector[2].expiration()); |
| 1322 } | 1325 } |
| 1323 | 1326 |
| 1324 // Regression test for https://crbug.com/615497. | 1327 // Regression test for https://crbug.com/615497. |
| 1325 TEST_P(HttpServerPropertiesManagerTest, DoNotLoadAltSvcForInsecureOrigins) { | 1328 TEST_P(HttpServerPropertiesManagerTest, DoNotLoadAltSvcForInsecureOrigins) { |
| 1326 std::unique_ptr<base::Value> server_value = base::JSONReader::Read( | 1329 std::unique_ptr<base::Value> server_value = base::JSONReader::Read( |
| 1327 "{\"alternative_service\":[{\"port\":443,\"protocol_str\":\"h2\"," | 1330 "{\"alternative_service\":[{\"port\":443,\"protocol_str\":\"h2\"," |
| 1328 "\"expiration\":\"9223372036854775807\"}]}"); | 1331 "\"expiration\":\"9223372036854775807\"}]}"); |
| 1329 ASSERT_TRUE(server_value); | 1332 ASSERT_TRUE(server_value); |
| 1330 base::DictionaryValue* server_dict; | 1333 base::DictionaryValue* server_dict; |
| 1331 ASSERT_TRUE(server_value->GetAsDictionary(&server_dict)); | 1334 ASSERT_TRUE(server_value->GetAsDictionary(&server_dict)); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1452 AlternativeServiceMap alternative_service_map(/*max_size=*/5); | 1455 AlternativeServiceMap alternative_service_map(/*max_size=*/5); |
| 1453 ASSERT_TRUE(http_server_props_manager_->AddToAlternativeServiceMap( | 1456 ASSERT_TRUE(http_server_props_manager_->AddToAlternativeServiceMap( |
| 1454 server, server_pref_dict, &alternative_service_map)); | 1457 server, server_pref_dict, &alternative_service_map)); |
| 1455 | 1458 |
| 1456 AlternativeServiceMap::iterator it = alternative_service_map.Get(server); | 1459 AlternativeServiceMap::iterator it = alternative_service_map.Get(server); |
| 1457 ASSERT_NE(alternative_service_map.end(), it); | 1460 ASSERT_NE(alternative_service_map.end(), it); |
| 1458 AlternativeServiceInfoVector alternative_service_info_vector = it->second; | 1461 AlternativeServiceInfoVector alternative_service_info_vector = it->second; |
| 1459 ASSERT_EQ(1u, alternative_service_info_vector.size()); | 1462 ASSERT_EQ(1u, alternative_service_info_vector.size()); |
| 1460 | 1463 |
| 1461 EXPECT_EQ(kProtoHTTP2, | 1464 EXPECT_EQ(kProtoHTTP2, |
| 1462 alternative_service_info_vector[0].alternative_service.protocol); | 1465 alternative_service_info_vector[0].alternative_service().protocol); |
| 1463 EXPECT_EQ("valid.example.com", | 1466 EXPECT_EQ("valid.example.com", |
| 1464 alternative_service_info_vector[0].alternative_service.host); | 1467 alternative_service_info_vector[0].alternative_service().host); |
| 1465 EXPECT_EQ(443, alternative_service_info_vector[0].alternative_service.port); | 1468 EXPECT_EQ(443, alternative_service_info_vector[0].alternative_service().port); |
| 1466 EXPECT_EQ(one_day_from_now_, alternative_service_info_vector[0].expiration); | 1469 EXPECT_EQ(one_day_from_now_, alternative_service_info_vector[0].expiration()); |
| 1467 } | 1470 } |
| 1468 | 1471 |
| 1469 TEST_P(HttpServerPropertiesManagerTest, ShutdownWithPendingUpdateCache0) { | 1472 TEST_P(HttpServerPropertiesManagerTest, ShutdownWithPendingUpdateCache0) { |
| 1470 // Post an update task to the UI thread. | 1473 // Post an update task to the UI thread. |
| 1471 http_server_props_manager_->ScheduleUpdateCacheOnPrefThread(); | 1474 http_server_props_manager_->ScheduleUpdateCacheOnPrefThread(); |
| 1472 // Shutdown comes before the task is executed. | 1475 // Shutdown comes before the task is executed. |
| 1473 http_server_props_manager_->ShutdownOnPrefSequence(); | 1476 http_server_props_manager_->ShutdownOnPrefSequence(); |
| 1474 http_server_props_manager_.reset(); | 1477 http_server_props_manager_.reset(); |
| 1475 // Run the task after shutdown and deletion. | 1478 // Run the task after shutdown and deletion. |
| 1476 EXPECT_FALSE(net_test_task_runner_->HasPendingTask()); | 1479 EXPECT_FALSE(net_test_task_runner_->HasPendingTask()); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1561 pref_test_task_runner_->FastForwardUntilNoTasksRemain(); | 1564 pref_test_task_runner_->FastForwardUntilNoTasksRemain(); |
| 1562 EXPECT_FALSE(net_test_task_runner_->HasPendingTask()); | 1565 EXPECT_FALSE(net_test_task_runner_->HasPendingTask()); |
| 1563 EXPECT_FALSE(pref_test_task_runner_->HasPendingTask()); | 1566 EXPECT_FALSE(pref_test_task_runner_->HasPendingTask()); |
| 1564 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); | 1567 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); |
| 1565 http_server_props_manager_.reset(); | 1568 http_server_props_manager_.reset(); |
| 1566 EXPECT_FALSE(net_test_task_runner_->HasPendingTask()); | 1569 EXPECT_FALSE(net_test_task_runner_->HasPendingTask()); |
| 1567 EXPECT_FALSE(pref_test_task_runner_->HasPendingTask()); | 1570 EXPECT_FALSE(pref_test_task_runner_->HasPendingTask()); |
| 1568 } | 1571 } |
| 1569 | 1572 |
| 1570 } // namespace net | 1573 } // namespace net |
| OLD | NEW |