OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/socket_stream/socket_stream_metrics.h" | 5 #include "net/socket_stream/socket_stream_metrics.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/metrics/statistics_recorder.h" |
9 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "testing/platform_test.h" | 12 #include "testing/platform_test.h" |
12 | 13 |
13 using base::Histogram; | 14 using base::Histogram; |
14 using base::StatisticsRecorder; | 15 using base::StatisticsRecorder; |
15 | 16 |
16 namespace net { | 17 namespace net { |
17 | 18 |
18 TEST(SocketStreamMetricsTest, ProtocolType) { | 19 TEST(SocketStreamMetricsTest, ProtocolType) { |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 196 |
196 // SentCounts. | 197 // SentCounts. |
197 ASSERT_TRUE(StatisticsRecorder::FindHistogram( | 198 ASSERT_TRUE(StatisticsRecorder::FindHistogram( |
198 "Net.SocketStream.SentCounts", &histogram)); | 199 "Net.SocketStream.SentCounts", &histogram)); |
199 EXPECT_EQ(Histogram::kUmaTargetedHistogramFlag, histogram->flags()); | 200 EXPECT_EQ(Histogram::kUmaTargetedHistogramFlag, histogram->flags()); |
200 histogram->SnapshotSample(&sample); | 201 histogram->SnapshotSample(&sample); |
201 EXPECT_EQ(3, sample.sum() - original_sent_counts); // 3 write requests. | 202 EXPECT_EQ(3, sample.sum() - original_sent_counts); // 3 write requests. |
202 } | 203 } |
203 | 204 |
204 } // namespace net | 205 } // namespace net |
OLD | NEW |