Index: components/translate/core/browser/translate_browser_metrics_unittest.cc |
diff --git a/components/translate/core/browser/translate_browser_metrics_unittest.cc b/components/translate/core/browser/translate_browser_metrics_unittest.cc |
index 17c53c35e95094bf8a24064686ca0f029304d841..c9a24c2b052dc566eda1704f3fae17040dc139f9 100644 |
--- a/components/translate/core/browser/translate_browser_metrics_unittest.cc |
+++ b/components/translate/core/browser/translate_browser_metrics_unittest.cc |
@@ -31,6 +31,7 @@ class MetricsRecorder { |
void CheckInitiationStatus(int expected_disabled_by_prefs, |
int expected_disabled_by_switch, |
int expected_disabled_by_config, |
+ int expected_disabled_by_build, |
int expected_language_is_not_supported, |
int expected_mime_type_is_not_supported, |
int expected_url_is_not_supported, |
@@ -52,6 +53,10 @@ class MetricsRecorder { |
expected_disabled_by_config, |
GetCountWithoutSnapshot(translate::TranslateBrowserMetrics:: |
INITIATION_STATUS_DISABLED_BY_CONFIG)); |
+ EXPECT_EQ( |
+ expected_disabled_by_build, |
+ GetCountWithoutSnapshot(translate::TranslateBrowserMetrics:: |
+ INITIATION_STATUS_DISABLED_BY_KEY)); |
EXPECT_EQ(expected_language_is_not_supported, |
GetCountWithoutSnapshot( |
translate::TranslateBrowserMetrics:: |
@@ -126,43 +131,46 @@ TEST(TranslateBrowserMetricsTest, ReportInitiationStatus) { |
MetricsRecorder recorder(translate::TranslateBrowserMetrics::GetMetricsName( |
translate::TranslateBrowserMetrics::UMA_INITIATION_STATUS)); |
- recorder.CheckInitiationStatus(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); |
+ recorder.CheckInitiationStatus(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); |
translate::TranslateBrowserMetrics::ReportInitiationStatus( |
translate::TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_PREFS); |
- recorder.CheckInitiationStatus(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); |
+ recorder.CheckInitiationStatus(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); |
translate::TranslateBrowserMetrics::ReportInitiationStatus( |
translate::TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_SWITCH); |
- recorder.CheckInitiationStatus(1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); |
+ recorder.CheckInitiationStatus(1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); |
translate::TranslateBrowserMetrics::ReportInitiationStatus( |
translate::TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_CONFIG); |
- recorder.CheckInitiationStatus(1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0); |
+ recorder.CheckInitiationStatus(1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); |
+ translate::TranslateBrowserMetrics::ReportInitiationStatus( |
+ translate::TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_KEY); |
+ recorder.CheckInitiationStatus(1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0); |
translate::TranslateBrowserMetrics::ReportInitiationStatus( |
translate::TranslateBrowserMetrics:: |
INITIATION_STATUS_LANGUAGE_IS_NOT_SUPPORTED); |
- recorder.CheckInitiationStatus(1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0); |
+ recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0); |
translate::TranslateBrowserMetrics::ReportInitiationStatus( |
translate::TranslateBrowserMetrics:: |
INITIATION_STATUS_MIME_TYPE_IS_NOT_SUPPORTED); |
- recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0); |
+ recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0); |
translate::TranslateBrowserMetrics::ReportInitiationStatus( |
translate::TranslateBrowserMetrics:: |
INITIATION_STATUS_URL_IS_NOT_SUPPORTED); |
- recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0); |
+ recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0); |
translate::TranslateBrowserMetrics::ReportInitiationStatus( |
translate::TranslateBrowserMetrics::INITIATION_STATUS_SIMILAR_LANGUAGES); |
- recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0); |
+ recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0); |
translate::TranslateBrowserMetrics::ReportInitiationStatus( |
translate::TranslateBrowserMetrics::INITIATION_STATUS_ACCEPT_LANGUAGES); |
- recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0); |
+ recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0); |
translate::TranslateBrowserMetrics::ReportInitiationStatus( |
translate::TranslateBrowserMetrics::INITIATION_STATUS_AUTO_BY_CONFIG); |
- recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0); |
+ recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0); |
translate::TranslateBrowserMetrics::ReportInitiationStatus( |
translate::TranslateBrowserMetrics::INITIATION_STATUS_AUTO_BY_LINK); |
- recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0); |
+ recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0); |
translate::TranslateBrowserMetrics::ReportInitiationStatus( |
translate::TranslateBrowserMetrics::INITIATION_STATUS_SHOW_INFOBAR); |
- recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); |
+ recorder.CheckInitiationStatus(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); |
} |
TEST(TranslateBrowserMetricsTest, ReportLanguageDetectionError) { |