Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_engine_unittest.cc

Issue 428783008: GetActiveUserProfile() should not be called before profile is initialized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment on GetProfile added. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698