Chromium Code Reviews| Index: blimp/engine/app/blimp_metrics_service_client_unittest.cc |
| diff --git a/blimp/engine/app/blimp_metrics_service_client_unittest.cc b/blimp/engine/app/blimp_metrics_service_client_unittest.cc |
| index f773e14ab6207ab74594193103da15b6bcde568f..a99b6d1b51f25f43291996964e74189ce5baa65b 100644 |
| --- a/blimp/engine/app/blimp_metrics_service_client_unittest.cc |
| +++ b/blimp/engine/app/blimp_metrics_service_client_unittest.cc |
| @@ -8,15 +8,17 @@ |
| #include <string> |
| #include "base/memory/ref_counted.h" |
| -#include "base/message_loop/message_loop.h" |
| #include "base/run_loop.h" |
| #include "base/test/test_simple_task_runner.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| #include "components/metrics/metrics_service.h" |
| +#include "components/metrics/stability_metrics_helper.h" |
| #include "components/pref_registry/pref_registry_syncable.h" |
| #include "components/prefs/in_memory_pref_store.h" |
| #include "components/prefs/pref_service.h" |
| #include "components/prefs/pref_service_factory.h" |
| +#include "content/public/browser/notification_service.h" |
| +#include "content/public/test/test_browser_thread_bundle.h" |
| #include "net/url_request/url_request_context_getter.h" |
| #include "net/url_request/url_request_test_util.h" |
| #include "testing/gmock/include/gmock/gmock.h" |
| @@ -37,9 +39,13 @@ class BlimpMetricsServiceClientTest : public testing::Test { |
| protected: |
| void SetUp() override { |
| + // Set up NotificationService |
| + notification_service_.reset(content::NotificationService::Create()); |
| + |
| // Set up PrefRegistry |
| pref_registry_ = new user_prefs::PrefRegistrySyncable(); |
| metrics::MetricsService::RegisterPrefs(pref_registry_.get()); |
| + metrics::StabilityMetricsHelper::RegisterPrefs(pref_registry_.get()); |
| // Set up PrefService |
| PrefServiceFactory pref_service_factory; |
| @@ -53,7 +59,8 @@ class BlimpMetricsServiceClientTest : public testing::Test { |
| base::ThreadTaskRunnerHandle::Get()); |
| // Set task runner global for MetricsService |
| - base::SetRecordActionTaskRunner(message_loop_.task_runner()); |
| + base::SetRecordActionTaskRunner( |
| + base::MessageLoop::current()->task_runner()); |
| // Set up BlimpMetricsServiceClient |
| client_.reset(new BlimpMetricsServiceClient(pref_service_.get(), |
| @@ -88,9 +95,11 @@ class BlimpMetricsServiceClientTest : public testing::Test { |
| } |
| private: |
| - base::MessageLoop message_loop_; |
| + content::TestBrowserThreadBundle thread_bundle_; |
| + std::unique_ptr<content::NotificationService> notification_service_; |
| scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry_; |
| std::unique_ptr<PrefService> pref_service_; |
| + // Needed for stability metrics provider. |
|
Jess
2016/06/09 18:09:59
Actually it is needed by the client for several ot
xyzzyz
2016/06/09 20:01:25
This comment was meant to refer to NotificationSer
|
| scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
| std::unique_ptr<BlimpMetricsServiceClient> client_; |