Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4277)

Unified Diff: chrome/browser/metrics/subprocess_metrics_provider_unittest.cc

Issue 2224063002: Use persistent memory for receiving metrics from sub-processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5b3e641d9eae898dd621b24099ac8a9dbfb78a4f 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-bundle makes the tests appear on the UI thread, something that is
+ // 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_;
« no previous file with comments | « chrome/browser/metrics/subprocess_metrics_provider.cc ('k') | content/browser/browser_child_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698