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

Side by Side Diff: net/http/http_server_properties_manager_unittest.cc

Issue 2070203002: Remove unused HttpServerProperites::ClearAlternativeServices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@AltSvcClear
Patch Set: fix Created 4 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 unified diff | Download patch
« no previous file with comments | « net/http/http_server_properties_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 spdy_server_mail, AlternativeServiceInfoVector()); 775 spdy_server_mail, AlternativeServiceInfoVector());
776 // ExpectScheduleUpdatePrefsOnNetworkThread() should not be called. 776 // ExpectScheduleUpdatePrefsOnNetworkThread() should not be called.
777 777
778 // Run the task. 778 // Run the task.
779 base::RunLoop().RunUntilIdle(); 779 base::RunLoop().RunUntilIdle();
780 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); 780 Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
781 781
782 EXPECT_FALSE(HasAlternativeService(spdy_server_mail)); 782 EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
783 } 783 }
784 784
785 TEST_P(HttpServerPropertiesManagerTest, ClearAlternativeServices) {
786 ExpectPrefsUpdate();
787 ExpectScheduleUpdatePrefsOnNetworkThread();
788
789 url::SchemeHostPort spdy_server_mail("http", "mail.google.com", 80);
790 EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
791 AlternativeService alternative_service(NPN_HTTP_2, "mail.google.com", 443);
792 http_server_props_manager_->SetAlternativeService(
793 spdy_server_mail, alternative_service, one_day_from_now_);
794 ExpectScheduleUpdatePrefsOnNetworkThread();
795 http_server_props_manager_->ClearAlternativeServices(spdy_server_mail);
796 // ExpectScheduleUpdatePrefsOnNetworkThread() should be called only once.
797 http_server_props_manager_->ClearAlternativeServices(spdy_server_mail);
798
799 // Run the task.
800 base::RunLoop().RunUntilIdle();
801 Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
802
803 EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
804 }
805
806 TEST_P(HttpServerPropertiesManagerTest, ConfirmAlternativeService) { 785 TEST_P(HttpServerPropertiesManagerTest, ConfirmAlternativeService) {
807 ExpectPrefsUpdate(); 786 ExpectPrefsUpdate();
808 787
809 url::SchemeHostPort spdy_server_mail("http", "mail.google.com", 80); 788 url::SchemeHostPort spdy_server_mail("http", "mail.google.com", 80);
810 EXPECT_FALSE(HasAlternativeService(spdy_server_mail)); 789 EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
811 AlternativeService alternative_service(NPN_HTTP_2, "mail.google.com", 443); 790 AlternativeService alternative_service(NPN_HTTP_2, "mail.google.com", 443);
812 791
813 ExpectScheduleUpdatePrefsOnNetworkThread(); 792 ExpectScheduleUpdatePrefsOnNetworkThread();
814 http_server_props_manager_->SetAlternativeService( 793 http_server_props_manager_->SetAlternativeService(
815 spdy_server_mail, alternative_service, one_day_from_now_); 794 spdy_server_mail, alternative_service, one_day_from_now_);
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 // Shutdown comes before the task is executed. 1365 // Shutdown comes before the task is executed.
1387 http_server_props_manager_->ShutdownOnPrefThread(); 1366 http_server_props_manager_->ShutdownOnPrefThread();
1388 // Run the task after shutdown, but before deletion. 1367 // Run the task after shutdown, but before deletion.
1389 base::RunLoop().RunUntilIdle(); 1368 base::RunLoop().RunUntilIdle();
1390 Mock::VerifyAndClearExpectations(http_server_props_manager_.get()); 1369 Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
1391 http_server_props_manager_.reset(); 1370 http_server_props_manager_.reset();
1392 base::RunLoop().RunUntilIdle(); 1371 base::RunLoop().RunUntilIdle();
1393 } 1372 }
1394 1373
1395 } // namespace net 1374 } // namespace net
OLDNEW
« 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