Chromium Code Reviews| Index: chrome/browser/metrics/subprocess_metrics_provider_unittest.cc |
| diff --git a/chrome/browser/metrics/subprocess_metrics_provider_unittest.cc b/chrome/browser/metrics/subprocess_metrics_provider_unittest.cc |
| index 4f3779c68a80670173cb0fc8db0797384da56258..72035b7bb02d63fd8b3e493b5a8896e9097b629c 100644 |
| --- a/chrome/browser/metrics/subprocess_metrics_provider_unittest.cc |
| +++ b/chrome/browser/metrics/subprocess_metrics_provider_unittest.cc |
| @@ -13,6 +13,7 @@ |
| #include "base/metrics/persistent_histogram_allocator.h" |
| #include "base/metrics/persistent_memory_allocator.h" |
| #include "base/metrics/statistics_recorder.h" |
| +#include "content/public/test/test_browser_thread_bundle.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| namespace { |
| @@ -56,7 +57,8 @@ class HistogramFlattenerDeltaRecorder : public base::HistogramFlattener { |
| class SubprocessMetricsProviderTest : public testing::Test { |
| protected: |
| - SubprocessMetricsProviderTest() { |
| + SubprocessMetricsProviderTest() |
| + : thread_bundle_(content::TestBrowserThreadBundle::DEFAULT) { |
| // Get this first so it isn't created inside a persistent allocator. |
| base::PersistentHistogramAllocator::GetCreateHistogramResultHistogram(); |
| @@ -117,6 +119,11 @@ class SubprocessMetricsProviderTest : public testing::Test { |
| } |
| private: |
| + // A thread-buldle makes the tests appear on the UI thread, something that is |
|
Alexei Svitkine (slow)
2016/08/19 16:31:56
Nit: buldle -> bundle
bcwhite
2016/08/19 17:19:46
Done.
|
| + // checked in methods called from the SubprocessMetricsProvider class under |
| + // test. This must be constructed before the |provider_| field. |
| + content::TestBrowserThreadBundle thread_bundle_; |
| + |
| SubprocessMetricsProvider provider_; |
| std::unique_ptr<base::StatisticsRecorder> test_recorder_; |