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 "base/metrics/histogram.h" | 5 #include "base/metrics/histogram.h" |
6 | 6 |
7 #include <climits> | 7 #include <climits> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/metrics/bucket_ranges.h" | 13 #include "base/metrics/bucket_ranges.h" |
14 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
15 #include "base/metrics/sample_vector.h" | 15 #include "base/metrics/sample_vector.h" |
16 #include "base/metrics/statistics_recorder.h" | 16 #include "base/metrics/statistics_recorder.h" |
17 #include "base/pickle.h" | 17 #include "base/pickle.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/googletest/include/gtest/gtest.h" |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 | 22 |
23 class HistogramTest : public testing::Test { | 23 class HistogramTest : public testing::Test { |
24 protected: | 24 protected: |
25 void SetUp() override { | 25 void SetUp() override { |
26 // Each test will have a clean state (no Histogram / BucketRanges | 26 // Each test will have a clean state (no Histogram / BucketRanges |
27 // registered). | 27 // registered). |
28 InitializeStatisticsRecorder(); | 28 InitializeStatisticsRecorder(); |
29 } | 29 } |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 // CustomHistogram needs at least 1 valid range. | 527 // CustomHistogram needs at least 1 valid range. |
528 custom_ranges.clear(); | 528 custom_ranges.clear(); |
529 custom_ranges.push_back(0); | 529 custom_ranges.push_back(0); |
530 EXPECT_DEATH(CustomHistogram::FactoryGet("BadRangesCustom3", custom_ranges, | 530 EXPECT_DEATH(CustomHistogram::FactoryGet("BadRangesCustom3", custom_ranges, |
531 HistogramBase::kNoFlags), | 531 HistogramBase::kNoFlags), |
532 ""); | 532 ""); |
533 } | 533 } |
534 #endif | 534 #endif |
535 | 535 |
536 } // namespace base | 536 } // namespace base |
OLD | NEW |