OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "base/metrics/histogram.h" | 6 #include "base/metrics/histogram.h" |
7 #include "base/metrics/histogram_samples.h" | 7 #include "base/metrics/histogram_samples.h" |
8 #include "base/metrics/statistics_recorder.h" | 8 #include "base/metrics/statistics_recorder.h" |
9 #include "base/test/histogram_tester.h" | 9 #include "base/test/histogram_tester.h" |
10 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 10 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 int candidate_id, | 90 int candidate_id, |
91 InputMethodEngineInterface::MouseButtonEvent button) override {} | 91 InputMethodEngineInterface::MouseButtonEvent button) override {} |
92 virtual void OnMenuItemActivated( | 92 virtual void OnMenuItemActivated( |
93 const std::string& engine_id, | 93 const std::string& engine_id, |
94 const std::string& menu_id) override {} | 94 const std::string& menu_id) override {} |
95 virtual void OnSurroundingTextChanged( | 95 virtual void OnSurroundingTextChanged( |
96 const std::string& engine_id, | 96 const std::string& engine_id, |
97 const std::string& text, | 97 const std::string& text, |
98 int cursor_pos, | 98 int cursor_pos, |
99 int anchor_pos) override {} | 99 int anchor_pos) override {} |
100 virtual void OnCompositionBoundsChanged(const gfx::Rect& bounds) override {} | |
Yuki
2014/10/24 09:52:33
It would be great if we can have a test.
Very very
Shu Chen
2014/10/24 15:38:06
Done.
| |
100 virtual void OnReset(const std::string& engine_id) override {} | 101 virtual void OnReset(const std::string& engine_id) override {} |
101 | 102 |
102 unsigned char GetCallsBitmapAndReset() { | 103 unsigned char GetCallsBitmapAndReset() { |
103 unsigned char ret = calls_bitmap_; | 104 unsigned char ret = calls_bitmap_; |
104 calls_bitmap_ = NONE; | 105 calls_bitmap_ = NONE; |
105 return ret; | 106 return ret; |
106 } | 107 } |
107 | 108 |
108 private: | 109 private: |
109 unsigned char calls_bitmap_; | 110 unsigned char calls_bitmap_; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 &error); | 246 &error); |
246 engine_->CommitText(1, "input\xE5\x85\xA5\xE5\x8A\x9B", &error); | 247 engine_->CommitText(1, "input\xE5\x85\xA5\xE5\x8A\x9B", &error); |
247 histograms.ExpectTotalCount("InputMethod.CommitLength", 3); | 248 histograms.ExpectTotalCount("InputMethod.CommitLength", 3); |
248 histograms.ExpectBucketCount("InputMethod.CommitLength", 5, 1); | 249 histograms.ExpectBucketCount("InputMethod.CommitLength", 5, 1); |
249 histograms.ExpectBucketCount("InputMethod.CommitLength", 2, 1); | 250 histograms.ExpectBucketCount("InputMethod.CommitLength", 2, 1); |
250 histograms.ExpectBucketCount("InputMethod.CommitLength", 7, 1); | 251 histograms.ExpectBucketCount("InputMethod.CommitLength", 7, 1); |
251 } | 252 } |
252 | 253 |
253 } // namespace input_method | 254 } // namespace input_method |
254 } // namespace chromeos | 255 } // namespace chromeos |
OLD | NEW |