diff options
author | kaiwang@chromium.org <kaiwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-01 21:34:08 +0000 |
---|---|---|
committer | kaiwang@chromium.org <kaiwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-01 21:34:08 +0000 |
commit | 34d062327516ae2496646d4c4d644e0e12386a3d (patch) | |
tree | d92e5703447f10aea57b1bdcfea060600252be9b /net/socket_stream | |
parent | ba125e774ed899bd119bcd9abd47dab68857315b (diff) | |
download | chromium_src-34d062327516ae2496646d4c4d644e0e12386a3d.zip chromium_src-34d062327516ae2496646d4c4d644e0e12386a3d.tar.gz chromium_src-34d062327516ae2496646d4c4d644e0e12386a3d.tar.bz2 |
This is a major refactor of Histogram related code:
1. Remove duplicated code from histogram.h/.cc,
including validating related code and BucketRanges related.
2. Constness of BucketRanges from Histograms, to prevent accidentally modification and provide a simpler interface.
3. Add/move tests.
Review URL: https://chromiumcodereview.appspot.com/10834011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket_stream')
-rw-r--r-- | net/socket_stream/socket_stream_metrics_unittest.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/socket_stream/socket_stream_metrics_unittest.cc b/net/socket_stream/socket_stream_metrics_unittest.cc index d4daf1e..f644f8d 100644 --- a/net/socket_stream/socket_stream_metrics_unittest.cc +++ b/net/socket_stream/socket_stream_metrics_unittest.cc @@ -41,7 +41,7 @@ TEST(SocketStreamMetricsTest, ProtocolType) { Histogram::SampleSet sample; histogram->SnapshotSample(&sample); - original.Resize(*histogram); // Ensure |original| size is same as |sample|. + original.Resize(histogram->bucket_count()); sample.Subtract(original); // Cancel the original values. EXPECT_EQ(1, sample.counts(SocketStreamMetrics::PROTOCOL_UNKNOWN)); EXPECT_EQ(2, sample.counts(SocketStreamMetrics::PROTOCOL_WEBSOCKET)); @@ -75,7 +75,7 @@ TEST(SocketStreamMetricsTest, ConnectionType) { Histogram::SampleSet sample; histogram->SnapshotSample(&sample); - original.Resize(*histogram); + original.Resize(histogram->bucket_count()); sample.Subtract(original); EXPECT_EQ(1, sample.counts(SocketStreamMetrics::ALL_CONNECTIONS)); EXPECT_EQ(2, sample.counts(SocketStreamMetrics::TUNNEL_CONNECTION)); @@ -106,7 +106,7 @@ TEST(SocketStreamMetricsTest, WireProtocolType) { Histogram::SampleSet sample; histogram->SnapshotSample(&sample); - original.Resize(*histogram); + original.Resize(histogram->bucket_count()); sample.Subtract(original); EXPECT_EQ(3, sample.counts(SocketStreamMetrics::WIRE_PROTOCOL_WEBSOCKET)); EXPECT_EQ(7, sample.counts(SocketStreamMetrics::WIRE_PROTOCOL_SPDY)); |