1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chromecast/metrics/cast_metrics_service_client.h"
7 #include "base/macros.h"
8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h"
10 #include "base/prefs/testing_pref_service.h"
11 #include "components/metrics/metrics_service.h"
12 #include "testing/gtest/include/gtest/gtest.h"
14 namespace chromecast
{
16 class CastMetricsTest
: public testing::Test
{
19 virtual ~CastMetricsTest() {}
22 virtual void SetUp() OVERRIDE
{
23 message_loop_
.reset(new base::MessageLoop());
24 prefs_
.reset(new TestingPrefServiceSimple());
25 ::metrics::MetricsService::RegisterPrefs(prefs_
->registry());
28 TestingPrefServiceSimple
* prefs() { return prefs_
.get(); }
31 scoped_ptr
<base::MessageLoop
> message_loop_
;
32 scoped_ptr
<TestingPrefServiceSimple
> prefs_
;
34 DISALLOW_COPY_AND_ASSIGN(CastMetricsTest
);
37 TEST_F(CastMetricsTest
, CreateMetricsServiceClient
) {
38 // Create and expect this to not crash.
39 metrics::CastMetricsServiceClient::Create(prefs(), NULL
);
42 } // namespace chromecast