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

Side by Side Diff: chromecast/metrics/cast_metrics_unittest.cc

Issue 522853002: Chromecast fix: MetricsStateManager segfaults if callbacks are empty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include order Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « chromecast/metrics/cast_metrics_service_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « chromecast/metrics/cast_metrics_service_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698