OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/metrics/file_metrics_provider.h" | 5 #include "components/metrics/file_metrics_provider.h" |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/files/memory_mapped_file.h" | 8 #include "base/files/memory_mapped_file.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "base/metrics/histogram_flattener.h" | 11 #include "base/metrics/histogram_flattener.h" |
12 #include "base/metrics/histogram_snapshot_manager.h" | 12 #include "base/metrics/histogram_snapshot_manager.h" |
13 #include "base/metrics/persistent_histogram_allocator.h" | 13 #include "base/metrics/persistent_histogram_allocator.h" |
14 #include "base/metrics/persistent_memory_allocator.h" | 14 #include "base/metrics/persistent_memory_allocator.h" |
15 #include "base/metrics/statistics_recorder.h" | 15 #include "base/metrics/statistics_recorder.h" |
16 #include "base/test/test_simple_task_runner.h" | 16 #include "base/test/test_simple_task_runner.h" |
17 #include "base/thread_task_runner_handle.h" | 17 #include "base/threading/thread_task_runner_handle.h" |
18 #include "components/metrics/metrics_pref_names.h" | 18 #include "components/metrics/metrics_pref_names.h" |
19 #include "components/prefs/pref_registry_simple.h" | 19 #include "components/prefs/pref_registry_simple.h" |
20 #include "components/prefs/testing_pref_service.h" | 20 #include "components/prefs/testing_pref_service.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 namespace { | 23 namespace { |
24 const char kMetricsName[] = "TestMetrics"; | 24 const char kMetricsName[] = "TestMetrics"; |
25 const char kMetricsFilename[] = "file.metrics"; | 25 const char kMetricsFilename[] = "file.metrics"; |
26 } // namespace | 26 } // namespace |
27 | 27 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 HistogramFlattenerDeltaRecorder flattener; | 183 HistogramFlattenerDeltaRecorder flattener; |
184 base::HistogramSnapshotManager snapshot_manager(&flattener); | 184 base::HistogramSnapshotManager snapshot_manager(&flattener); |
185 snapshot_manager.StartDeltas(); | 185 snapshot_manager.StartDeltas(); |
186 provider()->RecordHistogramSnapshots(&snapshot_manager); | 186 provider()->RecordHistogramSnapshots(&snapshot_manager); |
187 snapshot_manager.FinishDeltas(); | 187 snapshot_manager.FinishDeltas(); |
188 EXPECT_EQ(2U, flattener.GetRecordedDeltaHistogramNames().size()); | 188 EXPECT_EQ(2U, flattener.GetRecordedDeltaHistogramNames().size()); |
189 } | 189 } |
190 } | 190 } |
191 | 191 |
192 } // namespace metrics | 192 } // namespace metrics |
OLD | NEW |