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

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 unit test file 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/memory/scoped_ptr.h"
6 #include "base/message_loop/message_loop.h"
7 #include "base/prefs/testing_pref_service.h"
8 #include "chromecast/metrics/cast_metrics_service_client.h"
Alexei Svitkine (slow) 2014/08/29 17:58:29 Nit: Chromium convention is now for this to be the
gunsch 2014/08/29 18:26:05 Done.
gunsch 2014/08/29 18:26:47 Actually, had to put this back. It seems for unit
Alexei Svitkine (slow) 2014/08/29 18:43:15 Odd. Which presubmit? It certainly doesn't for ot
9 #include "components/metrics/metrics_service.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11
12 namespace chromecast {
13
14 class CastMetricsTest : public testing::Test {
15 protected:
16 virtual void SetUp() OVERRIDE {
17 message_loop_.reset(new base::MessageLoop());
18 prefs_.reset(new TestingPrefServiceSimple());
19 ::metrics::MetricsService::RegisterPrefs(prefs_->registry());
20 }
21
22 virtual void TearDown() OVERRIDE {
23 }
24
Alexei Svitkine (slow) 2014/08/29 17:58:29 Nit: Not sure you need to override this.
gunsch 2014/08/29 18:26:04 Done.
25 scoped_ptr<base::MessageLoop> message_loop_;
Alexei Svitkine (slow) 2014/08/29 17:58:29 Nit: Put a private: section above these and add DI
gunsch 2014/08/29 18:26:05 Done.
26 scoped_ptr<TestingPrefServiceSimple> prefs_;
27 };
28
29 TEST_F(CastMetricsTest, CreateMetricsServiceClient) {
30 // Create and expect this to not crash.
31 metrics::CastMetricsServiceClient::Create(prefs_.get(), NULL);
32 }
33
34 } // 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