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

Side by Side Diff: net/socket_stream/socket_stream_metrics_unittest.cc

Issue 10703037: Move StatisticsRecorder out of histogram.cc/h for further refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « net/disk_cache/stats_histogram.cc ('k') | net/url_request/url_request_throttler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « net/disk_cache/stats_histogram.cc ('k') | net/url_request/url_request_throttler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698