| 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 "chrome/browser/chromeos/input_method/input_method_configuration.h" | 9 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
| 10 #include "chrome/browser/chromeos/input_method/input_method_engine.h" | 10 #include "chrome/browser/chromeos/input_method/input_method_engine.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 scoped_ptr<base::HistogramSamples> delta_samples( | 168 scoped_ptr<base::HistogramSamples> delta_samples( |
| 169 GetHistogramSamplesDelta(histogram_name)); | 169 GetHistogramSamplesDelta(histogram_name)); |
| 170 EXPECT_EQ(total_count, delta_samples->TotalCount()); | 170 EXPECT_EQ(total_count, delta_samples->TotalCount()); |
| 171 EXPECT_EQ(sample_count, delta_samples->GetCount(sample)); | 171 EXPECT_EQ(sample_count, delta_samples->GetCount(sample)); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void CreateEngine(bool whitelisted) { | 174 void CreateEngine(bool whitelisted) { |
| 175 engine_.reset(new InputMethodEngine()); | 175 engine_.reset(new InputMethodEngine()); |
| 176 observer_ = new TestObserver(); | 176 observer_ = new TestObserver(); |
| 177 scoped_ptr<InputMethodEngineInterface::Observer> observer_ptr(observer_); | 177 scoped_ptr<InputMethodEngineInterface::Observer> observer_ptr(observer_); |
| 178 engine_->Initialize(observer_ptr.Pass(), | 178 engine_->Initialize(NULL /* profile */, |
| 179 observer_ptr.Pass(), |
| 179 "", | 180 "", |
| 180 whitelisted ? kTestExtensionId : kTestExtensionId2, | 181 whitelisted ? kTestExtensionId : kTestExtensionId2, |
| 181 kTestImeEngineId, | 182 kTestImeEngineId, |
| 182 languages_, | 183 languages_, |
| 183 layouts_, | 184 layouts_, |
| 184 options_page_, | 185 options_page_, |
| 185 input_view_); | 186 input_view_); |
| 186 } | 187 } |
| 187 | 188 |
| 188 void FocusIn(ui::TextInputType input_type) { | 189 void FocusIn(ui::TextInputType input_type) { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 engine_->CommitText(1, "入力", &error); | 293 engine_->CommitText(1, "入力", &error); |
| 293 engine_->CommitText(1, "input入力", &error); | 294 engine_->CommitText(1, "input入力", &error); |
| 294 ExpectNewSample("InputMethod.Commit.test_engine_id", 1, 3, 3); | 295 ExpectNewSample("InputMethod.Commit.test_engine_id", 1, 3, 3); |
| 295 ExpectNewSample("InputMethod.CommitCharacter.test_engine_id", 5, 3, 1); | 296 ExpectNewSample("InputMethod.CommitCharacter.test_engine_id", 5, 3, 1); |
| 296 ExpectNewSample("InputMethod.CommitCharacter.test_engine_id", 2, 3, 1); | 297 ExpectNewSample("InputMethod.CommitCharacter.test_engine_id", 2, 3, 1); |
| 297 ExpectNewSample("InputMethod.CommitCharacter.test_engine_id", 7, 3, 1); | 298 ExpectNewSample("InputMethod.CommitCharacter.test_engine_id", 7, 3, 1); |
| 298 } | 299 } |
| 299 | 300 |
| 300 } // namespace input_method | 301 } // namespace input_method |
| 301 } // namespace chromeos | 302 } // namespace chromeos |
| OLD | NEW |