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

Side by Side Diff: net/http/http_server_properties_impl_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, 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_impl.h" 5 #include "net/http/http_server_properties_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 } 800 }
801 801
802 TEST_F(ServerNetworkStatsServerPropertiesTest, SetServerNetworkStats) { 802 TEST_F(ServerNetworkStatsServerPropertiesTest, SetServerNetworkStats) {
803 HostPortPair foo_server("foo", 80); 803 HostPortPair foo_server("foo", 80);
804 const ServerNetworkStats* stats = impl_.GetServerNetworkStats(foo_server); 804 const ServerNetworkStats* stats = impl_.GetServerNetworkStats(foo_server);
805 EXPECT_EQ(NULL, stats); 805 EXPECT_EQ(NULL, stats);
806 806
807 ServerNetworkStats stats1; 807 ServerNetworkStats stats1;
808 stats1.srtt = base::TimeDelta::FromMicroseconds(10); 808 stats1.srtt = base::TimeDelta::FromMicroseconds(10);
809 stats1.bandwidth_estimate = QuicBandwidth::FromBitsPerSecond(100); 809 stats1.bandwidth_estimate = QuicBandwidth::FromBitsPerSecond(100);
810 impl_.SetServerNetworkStats(foo_server, stats1); 810 EXPECT_TRUE(impl_.SetServerNetworkStats(foo_server, stats1));
811 EXPECT_FALSE(impl_.SetServerNetworkStats(foo_server, stats1));
811 812
812 const ServerNetworkStats* stats2 = impl_.GetServerNetworkStats(foo_server); 813 const ServerNetworkStats* stats2 = impl_.GetServerNetworkStats(foo_server);
813 EXPECT_EQ(10, stats2->srtt.ToInternalValue()); 814 EXPECT_EQ(10, stats2->srtt.ToInternalValue());
814 EXPECT_EQ(100, stats2->bandwidth_estimate.ToBitsPerSecond()); 815 EXPECT_EQ(100, stats2->bandwidth_estimate.ToBitsPerSecond());
815 816
816 impl_.Clear(); 817 impl_.Clear();
817 const ServerNetworkStats* stats3 = impl_.GetServerNetworkStats(foo_server); 818 const ServerNetworkStats* stats3 = impl_.GetServerNetworkStats(foo_server);
818 EXPECT_EQ(NULL, stats3); 819 EXPECT_EQ(NULL, stats3);
819 } 820 }
820 821
821 } // namespace 822 } // namespace
822 823
823 } // namespace net 824 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698