| 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/renderer/translate/translate_helper_metrics.h" | 5 #include "chrome/common/translate/translate_helper_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" |
| 11 #include "base/metrics/statistics_recorder.h" | 11 #include "base/metrics/statistics_recorder.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "testing/platform_test.h" | 13 #include "testing/platform_test.h" |
| 14 | 14 |
| 15 using base::HistogramBase; | 15 using base::HistogramBase; |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 TranslateHelperMetrics::UMA_LANGUAGE_DETECTION)); | 295 TranslateHelperMetrics::UMA_LANGUAGE_DETECTION)); |
| 296 recorder.CheckTotalCount(0); | 296 recorder.CheckTotalCount(0); |
| 297 TimeTicks begin = TimeTicks::Now(); | 297 TimeTicks begin = TimeTicks::Now(); |
| 298 TimeTicks end = begin + base::TimeDelta::FromMicroseconds(9009); | 298 TimeTicks end = begin + base::TimeDelta::FromMicroseconds(9009); |
| 299 TranslateHelperMetrics::ReportLanguageDetectionTime(begin, end); | 299 TranslateHelperMetrics::ReportLanguageDetectionTime(begin, end); |
| 300 recorder.CheckValueInLogs(9.009); | 300 recorder.CheckValueInLogs(9.009); |
| 301 recorder.CheckTotalCount(1); | 301 recorder.CheckTotalCount(1); |
| 302 } | 302 } |
| 303 | 303 |
| 304 #endif // defined(ENABLE_LANGUAGE_DETECTION) | 304 #endif // defined(ENABLE_LANGUAGE_DETECTION) |
| OLD | NEW |