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 <limits.h> | 7 #include <limits.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 void TearDown() override { | 47 void TearDown() override { |
48 if (allocator_) { | 48 if (allocator_) { |
49 ASSERT_FALSE(allocator_->IsFull()); | 49 ASSERT_FALSE(allocator_->IsFull()); |
50 ASSERT_FALSE(allocator_->IsCorrupt()); | 50 ASSERT_FALSE(allocator_->IsCorrupt()); |
51 } | 51 } |
52 UninitializeStatisticsRecorder(); | 52 UninitializeStatisticsRecorder(); |
53 DestroyPersistentMemoryAllocator(); | 53 DestroyPersistentMemoryAllocator(); |
54 } | 54 } |
55 | 55 |
56 void InitializeStatisticsRecorder() { | 56 void InitializeStatisticsRecorder() { |
57 StatisticsRecorder::ResetForTesting(); | |
58 statistics_recorder_ = new StatisticsRecorder(); | 57 statistics_recorder_ = new StatisticsRecorder(); |
59 } | 58 } |
60 | 59 |
61 void UninitializeStatisticsRecorder() { | 60 void UninitializeStatisticsRecorder() { |
62 delete statistics_recorder_; | 61 delete statistics_recorder_; |
63 statistics_recorder_ = NULL; | 62 statistics_recorder_ = NULL; |
64 } | 63 } |
65 | 64 |
66 void CreatePersistentMemoryAllocator() { | 65 void CreatePersistentMemoryAllocator() { |
67 // By getting the results-histogram before any persistent allocator | 66 // By getting the results-histogram before any persistent allocator |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 // CustomHistogram needs at least 1 valid range. | 796 // CustomHistogram needs at least 1 valid range. |
798 custom_ranges.clear(); | 797 custom_ranges.clear(); |
799 custom_ranges.push_back(0); | 798 custom_ranges.push_back(0); |
800 EXPECT_DEATH(CustomHistogram::FactoryGet("BadRangesCustom3", custom_ranges, | 799 EXPECT_DEATH(CustomHistogram::FactoryGet("BadRangesCustom3", custom_ranges, |
801 HistogramBase::kNoFlags), | 800 HistogramBase::kNoFlags), |
802 ""); | 801 ""); |
803 } | 802 } |
804 #endif | 803 #endif |
805 | 804 |
806 } // namespace base | 805 } // namespace base |
OLD | NEW |