OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/metrics/persistent_sample_map.h" | 5 #include "base/metrics/persistent_sample_map.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/metrics/persistent_histogram_allocator.h" | 10 #include "base/metrics/persistent_histogram_allocator.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 HistogramSamples::Metadata meta; | 240 HistogramSamples::Metadata meta; |
241 PersistentSampleMap samples(1, allocator.get(), &meta); | 241 PersistentSampleMap samples(1, allocator.get(), &meta); |
242 | 242 |
243 std::unique_ptr<SampleCountIterator> it = samples.Iterator(); | 243 std::unique_ptr<SampleCountIterator> it = samples.Iterator(); |
244 | 244 |
245 EXPECT_TRUE(it->Done()); | 245 EXPECT_TRUE(it->Done()); |
246 | 246 |
247 HistogramBase::Sample min; | 247 HistogramBase::Sample min; |
248 HistogramBase::Sample max; | 248 HistogramBase::Sample max; |
249 HistogramBase::Count count; | 249 HistogramBase::Count count; |
250 EXPECT_DCHECK_DEATH(it->Get(&min, &max, &count), ""); | 250 EXPECT_DCHECK_DEATH(it->Get(&min, &max, &count)); |
251 | 251 |
252 EXPECT_DCHECK_DEATH(it->Next(), ""); | 252 EXPECT_DCHECK_DEATH(it->Next()); |
253 | 253 |
254 samples.Accumulate(1, 100); | 254 samples.Accumulate(1, 100); |
255 it = samples.Iterator(); | 255 it = samples.Iterator(); |
256 EXPECT_FALSE(it->Done()); | 256 EXPECT_FALSE(it->Done()); |
257 } | 257 } |
258 | 258 |
259 } // namespace | 259 } // namespace |
260 } // namespace base | 260 } // namespace base |
OLD | NEW |