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

Side by Side Diff: base/test/histogram_tester.cc

Issue 1466413002: Update gtest to 786564fa4a3c, switch to googlemock in gtest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « base/test/gtest_xml_unittest_result_printer.h ('k') | base/test/histogram_tester_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 2014 The Chromium Authors. All rights reserved. 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 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 "base/test/histogram_tester.h" 5 #include "base/test/histogram_tester.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/metrics/histogram_samples.h" 8 #include "base/metrics/histogram_samples.h"
9 #include "base/metrics/sample_map.h" 9 #include "base/metrics/sample_map.h"
10 #include "base/metrics/statistics_recorder.h" 10 #include "base/metrics/statistics_recorder.h"
11 #include "base/stl_util.h" 11 #include "base/stl_util.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/googletest/include/gtest/gtest.h"
13 13
14 namespace base { 14 namespace base {
15 15
16 HistogramTester::HistogramTester() { 16 HistogramTester::HistogramTester() {
17 StatisticsRecorder::Initialize(); // Safe to call multiple times. 17 StatisticsRecorder::Initialize(); // Safe to call multiple times.
18 18
19 // Record any histogram data that exists when the object is created so it can 19 // Record any histogram data that exists when the object is created so it can
20 // be subtracted later. 20 // be subtracted later.
21 StatisticsRecorder::Histograms histograms; 21 StatisticsRecorder::Histograms histograms;
22 StatisticsRecorder::GetSnapshot(std::string(), &histograms); 22 StatisticsRecorder::GetSnapshot(std::string(), &histograms);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 bool Bucket::operator==(const Bucket& other) const { 167 bool Bucket::operator==(const Bucket& other) const {
168 return min == other.min && count == other.count; 168 return min == other.min && count == other.count;
169 } 169 }
170 170
171 void PrintTo(const Bucket& bucket, std::ostream* os) { 171 void PrintTo(const Bucket& bucket, std::ostream* os) {
172 *os << "Bucket " << bucket.min << ": " << bucket.count; 172 *os << "Bucket " << bucket.min << ": " << bucket.count;
173 } 173 }
174 174
175 } // namespace base 175 } // namespace base
OLDNEW
« no previous file with comments | « base/test/gtest_xml_unittest_result_printer.h ('k') | base/test/histogram_tester_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698