OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/translate/translate_manager_metrics.h" | 5 #include "chrome/browser/translate/translate_manager_metrics.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/metrics/histogram_samples.h" | 10 #include "base/metrics/histogram_samples.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 TEST(TranslateManagerMetricsTest, ReportedUnsupportedLanguageAtInitiation) { | 163 TEST(TranslateManagerMetricsTest, ReportedUnsupportedLanguageAtInitiation) { |
164 const int ENGLISH = 25966; | 164 const int ENGLISH = 25966; |
165 | 165 |
166 MetricsRecorder recorder(TranslateManagerMetrics::GetMetricsName( | 166 MetricsRecorder recorder(TranslateManagerMetrics::GetMetricsName( |
167 TranslateManagerMetrics::UMA_UNSUPPORTED_LANGUAGE_AT_INITIATION)); | 167 TranslateManagerMetrics::UMA_UNSUPPORTED_LANGUAGE_AT_INITIATION)); |
168 EXPECT_EQ(0, recorder.GetTotalCount()); | 168 EXPECT_EQ(0, recorder.GetTotalCount()); |
169 TranslateManagerMetrics::ReportUnsupportedLanguageAtInitiation("en"); | 169 TranslateManagerMetrics::ReportUnsupportedLanguageAtInitiation("en"); |
170 EXPECT_EQ(1, recorder.GetCount(ENGLISH)); | 170 EXPECT_EQ(1, recorder.GetCount(ENGLISH)); |
171 } | 171 } |
| 172 |
| 173 TEST(TranslateManagerMetricsTest, ReportedLocalesOnDisabledByPrefs) { |
| 174 const int ENGLISH = 25966; |
| 175 |
| 176 MetricsRecorder recorder(TranslateManagerMetrics::GetMetricsName( |
| 177 TranslateManagerMetrics::UMA_LOCALES_ON_DISABLED_BY_PREFS)); |
| 178 EXPECT_EQ(0, recorder.GetTotalCount()); |
| 179 TranslateManagerMetrics::ReportLocalesOnDisabledByPrefs("en"); |
| 180 EXPECT_EQ(1, recorder.GetCount(ENGLISH)); |
| 181 } |
OLD | NEW |