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

Side by Side Diff: base/test/statistics_delta_reader_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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/test/statistics_delta_reader.h"
6
7 #include "base/memory/scoped_ptr.h"
8 #include "base/metrics/histogram.h"
9 #include "base/metrics/histogram_samples.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11
12 namespace base {
13
14 TEST(StatisticsDeltaReaderTest, Scope) {
15 // Record a histogram before the creation of the recorder.
16 UMA_HISTOGRAM_BOOLEAN("Test", true);
17
18 StatisticsDeltaReader reader;
19
20 // Verify that no histogram is recorded.
21 scoped_ptr<HistogramSamples> samples(
22 reader.GetHistogramSamplesSinceCreation("Test"));
23 EXPECT_FALSE(samples);
24
25 // Record a histogram after the creation of the recorder.
26 UMA_HISTOGRAM_BOOLEAN("Test", true);
27
28 // Verify that one histogram is recorded.
29 samples = reader.GetHistogramSamplesSinceCreation("Test");
30 EXPECT_TRUE(samples);
31 EXPECT_EQ(1, samples->TotalCount());
32 }
33
34 } // namespace base
OLDNEW
« no previous file with comments | « base/test/statistics_delta_reader.cc ('k') | chrome/browser/accessibility/browser_accessibility_state_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698