| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/metrics/histogram_base.h" | 8 #include "base/metrics/histogram_base.h" |
| 9 #include "base/metrics/sparse_histogram.h" | 9 #include "base/metrics/sparse_histogram.h" |
| 10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
| 11 #include "base/pickle.h" | 11 #include "base/pickle.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 class HistogramBaseTest : public testing::Test { | 16 class HistogramBaseTest : public testing::Test { |
| 17 protected: | 17 protected: |
| 18 HistogramBaseTest() { | 18 HistogramBaseTest() { |
| 19 // Each test will have a clean state (no Histogram / BucketRanges | 19 // Each test will have a clean state (no Histogram / BucketRanges |
| 20 // registered). | 20 // registered). |
| 21 statistics_recorder_ = NULL; | 21 statistics_recorder_ = NULL; |
| 22 ResetStatisticsRecorder(); | 22 ResetStatisticsRecorder(); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 PickleIterator iter2(pickle); | 147 PickleIterator iter2(pickle); |
| 148 deserialized = DeserializeHistogramInfo(&iter2); | 148 deserialized = DeserializeHistogramInfo(&iter2); |
| 149 EXPECT_TRUE(deserialized); | 149 EXPECT_TRUE(deserialized); |
| 150 EXPECT_NE(histogram, deserialized); | 150 EXPECT_NE(histogram, deserialized); |
| 151 EXPECT_EQ("TestHistogram", deserialized->histogram_name()); | 151 EXPECT_EQ("TestHistogram", deserialized->histogram_name()); |
| 152 EXPECT_EQ(0, deserialized->flags()); | 152 EXPECT_EQ(0, deserialized->flags()); |
| 153 } | 153 } |
| 154 | 154 |
| 155 } // namespace base | 155 } // namespace base |
| OLD | NEW |