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

Unified Diff: net/spdy/spdy_session_unittest.cc

Issue 379283002: Rework UMAHistogramHelper and StatisticsDeltaReader into [Chrome]HistogramTester. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/browser_test_utils.cc ('k') | net/url_request/url_request_throttler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session_unittest.cc
diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc
index 8194fe7d09788cced9fbd0634525bc5f70673100..a9836c8916c97c50fb00a11c757c4e2283948e68 100644
--- a/net/spdy/spdy_session_unittest.cc
+++ b/net/spdy/spdy_session_unittest.cc
@@ -9,7 +9,7 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "base/run_loop.h"
-#include "base/test/statistics_delta_reader.h"
+#include "base/test/histogram_tester.h"
#include "net/base/io_buffer.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_log_unittest.h"
@@ -1792,25 +1792,26 @@ TEST_P(SpdySessionTest, SynCompressionHistograms) {
EXPECT_TRUE(spdy_stream->HasUrlFromHeaders());
// Write request headers & capture resulting histogram update.
- base::StatisticsDeltaReader statistics_delta_reader;
- data.RunFor(1);
- scoped_ptr<base::HistogramSamples> samples(
- statistics_delta_reader.GetHistogramSamplesSinceCreation(
- "Net.SpdySynStreamCompressionPercentage"));
+ base::HistogramTester histogram_tester;
+ data.RunFor(1);
// Regression test of compression performance under the request fixture.
switch (spdy_util_.spdy_version()) {
case SPDY2:
- EXPECT_EQ(samples->GetCount(0), 1);
+ histogram_tester.ExpectBucketCount(
+ "Net.SpdySynStreamCompressionPercentage", 0, 1);
break;
case SPDY3:
- EXPECT_EQ(samples->GetCount(30), 1);
+ histogram_tester.ExpectBucketCount(
+ "Net.SpdySynStreamCompressionPercentage", 30, 1);
break;
case SPDY4:
- EXPECT_EQ(samples->GetCount(82), 1);
+ histogram_tester.ExpectBucketCount(
+ "Net.SpdySynStreamCompressionPercentage", 82, 1);
break;
case SPDY5:
- EXPECT_EQ(samples->GetCount(82), 1);
+ histogram_tester.ExpectBucketCount(
+ "Net.SpdySynStreamCompressionPercentage", 82, 1);
break;
default:
NOTREACHED();
« no previous file with comments | « content/public/test/browser_test_utils.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