OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #include "base/macros.h" | |
6 #include "base/memory/scoped_ptr.h" | |
7 #include "base/message_loop/message_loop.h" | |
8 #include "base/prefs/testing_pref_service.h" | |
9 #include "chromecast/metrics/cast_metrics_service_client.h" | |
10 #include "components/metrics/metrics_service.h" | |
11 #include "testing/gtest/include/gtest/gtest.h" | |
12 | |
13 namespace chromecast { | |
14 | |
15 class CastMetricsTest : public testing::Test { | |
16 public: | |
17 CastMetricsTest() {} | |
lcwu1
2014/08/29 18:39:24
We should add a virtual destructor here.
gunsch
2014/08/29 18:52:01
Done.
| |
18 | |
19 protected: | |
20 virtual void SetUp() OVERRIDE { | |
21 message_loop_.reset(new base::MessageLoop()); | |
22 prefs_.reset(new TestingPrefServiceSimple()); | |
23 ::metrics::MetricsService::RegisterPrefs(prefs_->registry()); | |
24 } | |
25 | |
26 TestingPrefServiceSimple* prefs() { return prefs_.get(); } | |
27 | |
28 private: | |
29 scoped_ptr<base::MessageLoop> message_loop_; | |
30 scoped_ptr<TestingPrefServiceSimple> prefs_; | |
31 | |
32 DISALLOW_COPY_AND_ASSIGN(CastMetricsTest); | |
33 }; | |
34 | |
35 TEST_F(CastMetricsTest, CreateMetricsServiceClient) { | |
36 // Create and expect this to not crash. | |
37 metrics::CastMetricsServiceClient::Create(prefs(), NULL); | |
38 } | |
39 | |
40 } // namespace chromecast | |
OLD | NEW |