OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/metrics/histogram_base.h" | 8 #include "base/metrics/histogram_base.h" |
9 #include "base/metrics/histogram_samples.h" | 9 #include "base/metrics/histogram_samples.h" |
10 #include "base/metrics/sample_map.h" | 10 #include "base/metrics/sample_map.h" |
11 #include "base/metrics/sparse_histogram.h" | 11 #include "base/metrics/sparse_histogram.h" |
12 #include "base/metrics/statistics_recorder.h" | 12 #include "base/metrics/statistics_recorder.h" |
13 #include "base/pickle.h" | 13 #include "base/pickle.h" |
14 #include "base/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 | 18 |
19 class SparseHistogramTest : public testing::Test { | 19 class SparseHistogramTest : public testing::Test { |
20 protected: | 20 protected: |
21 virtual void SetUp() { | 21 virtual void SetUp() { |
22 // Each test will have a clean state (no Histogram / BucketRanges | 22 // Each test will have a clean state (no Histogram / BucketRanges |
23 // registered). | 23 // registered). |
24 InitializeStatisticsRecorder(); | 24 InitializeStatisticsRecorder(); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 135 |
136 int flag; | 136 int flag; |
137 EXPECT_TRUE(iter.ReadInt(&flag)); | 137 EXPECT_TRUE(iter.ReadInt(&flag)); |
138 EXPECT_EQ(HistogramBase::kIPCSerializationSourceFlag, flag); | 138 EXPECT_EQ(HistogramBase::kIPCSerializationSourceFlag, flag); |
139 | 139 |
140 // No more data in the pickle. | 140 // No more data in the pickle. |
141 EXPECT_FALSE(iter.SkipBytes(1)); | 141 EXPECT_FALSE(iter.SkipBytes(1)); |
142 } | 142 } |
143 | 143 |
144 } // namespace base | 144 } // namespace base |
OLD | NEW |