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

Unified Diff: chrome/browser/chromeos/input_method/textinput_test_helper.cc

Issue 334573004: Fixes unittests with --enable-text-input-focus-manager flag enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed more unittests. Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/workspace/workspace_layout_manager_unittest.cc ('k') | ui/base/ime/input_method_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/input_method/textinput_test_helper.cc
diff --git a/chrome/browser/chromeos/input_method/textinput_test_helper.cc b/chrome/browser/chromeos/input_method/textinput_test_helper.cc
index 1c2c3f8f31c5b2f37620ebfe86f6d1cc7c978f62..b4c601a439e7029b382f32a689225e2edae585bb 100644
--- a/chrome/browser/chromeos/input_method/textinput_test_helper.cc
+++ b/chrome/browser/chromeos/input_method/textinput_test_helper.cc
@@ -73,7 +73,8 @@ ui::TextInputClient* TextInputTestHelper::GetTextInputClient() const {
void TextInputTestHelper::OnTextInputTypeChanged(
const ui::TextInputClient* client) {
- latest_text_input_type_ = client->GetTextInputType();
+ latest_text_input_type_ =
+ client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE;
if (waiting_type_ == WAIT_ON_TEXT_INPUT_TYPE_CHANGED)
base::MessageLoop::current()->Quit();
}
@@ -100,10 +101,13 @@ void TextInputTestHelper::OnBlur() {
void TextInputTestHelper::OnCaretBoundsChanged(
const ui::TextInputClient* client) {
gfx::Range text_range;
- if (!GetTextInputClient()->GetTextRange(&text_range) ||
- !GetTextInputClient()->GetTextFromRange(text_range, &surrounding_text_) ||
- !GetTextInputClient()->GetSelectionRange(&selection_range_))
+ if (GetTextInputClient()) {
+ if (!GetTextInputClient()->GetTextRange(&text_range) ||
+ !GetTextInputClient()->GetTextFromRange(text_range,
+ &surrounding_text_) ||
+ !GetTextInputClient()->GetSelectionRange(&selection_range_))
return;
+ }
if (waiting_type_ == WAIT_ON_CARET_BOUNDS_CHANGED)
base::MessageLoop::current()->Quit();
}
« no previous file with comments | « ash/wm/workspace/workspace_layout_manager_unittest.cc ('k') | ui/base/ime/input_method_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698