OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/spellchecker/spellcheck_host_metrics.h" | 5 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include <stddef.h> |
| 8 |
| 9 #include "base/macros.h" |
8 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
10 #include "base/metrics/histogram_samples.h" | 12 #include "base/metrics/histogram_samples.h" |
11 #include "base/metrics/statistics_recorder.h" | 13 #include "base/metrics/statistics_recorder.h" |
12 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
13 #include "base/test/histogram_tester.h" | 15 #include "base/test/histogram_tester.h" |
| 16 #include "build/build_config.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
15 | 18 |
16 #if defined(OS_WIN) | 19 #if defined(OS_WIN) |
17 // For version specific disabled tests below (http://crbug.com/230534). | 20 // For version specific disabled tests below (http://crbug.com/230534). |
18 #include "base/win/windows_version.h" | 21 #include "base/win/windows_version.h" |
19 #endif | 22 #endif |
20 | 23 |
21 class SpellcheckHostMetricsTest : public testing::Test { | 24 class SpellcheckHostMetricsTest : public testing::Test { |
22 public: | 25 public: |
23 SpellcheckHostMetricsTest() { | 26 SpellcheckHostMetricsTest() { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 106 |
104 histogram_tester1.ExpectBucketCount(kMetricName, 0, 1); | 107 histogram_tester1.ExpectBucketCount(kMetricName, 0, 1); |
105 histogram_tester1.ExpectBucketCount(kMetricName, 1, 0); | 108 histogram_tester1.ExpectBucketCount(kMetricName, 1, 0); |
106 | 109 |
107 base::HistogramTester histogram_tester2; | 110 base::HistogramTester histogram_tester2; |
108 | 111 |
109 metrics()->RecordSpellingServiceStats(true); | 112 metrics()->RecordSpellingServiceStats(true); |
110 histogram_tester2.ExpectBucketCount(kMetricName, 0, 0); | 113 histogram_tester2.ExpectBucketCount(kMetricName, 0, 0); |
111 histogram_tester2.ExpectBucketCount(kMetricName, 1, 1); | 114 histogram_tester2.ExpectBucketCount(kMetricName, 1, 1); |
112 } | 115 } |
OLD | NEW |