Chromium Code Reviews| Index: chromecast/metrics/cast_metrics_unittest.cc |
| diff --git a/chromecast/metrics/cast_metrics_unittest.cc b/chromecast/metrics/cast_metrics_unittest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..54bbdecee7cc9941971fc9d58b66bb08165620a3 |
| --- /dev/null |
| +++ b/chromecast/metrics/cast_metrics_unittest.cc |
| @@ -0,0 +1,34 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/message_loop/message_loop.h" |
| +#include "base/prefs/testing_pref_service.h" |
| +#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
|
| +#include "components/metrics/metrics_service.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +namespace chromecast { |
| + |
| +class CastMetricsTest : public testing::Test { |
| + protected: |
| + virtual void SetUp() OVERRIDE { |
| + message_loop_.reset(new base::MessageLoop()); |
| + prefs_.reset(new TestingPrefServiceSimple()); |
| + ::metrics::MetricsService::RegisterPrefs(prefs_->registry()); |
| + } |
| + |
| + virtual void TearDown() OVERRIDE { |
| + } |
| + |
|
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.
|
| + 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.
|
| + scoped_ptr<TestingPrefServiceSimple> prefs_; |
| +}; |
| + |
| +TEST_F(CastMetricsTest, CreateMetricsServiceClient) { |
| + // Create and expect this to not crash. |
| + metrics::CastMetricsServiceClient::Create(prefs_.get(), NULL); |
| +} |
| + |
| +} // namespace chromecast |