| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_TEXTINPUT_TEST_HELPER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_TEXTINPUT_TEST_HELPER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_TEXTINPUT_TEST_HELPER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_TEXTINPUT_TEST_HELPER_H_ |
| 7 | 7 |
| 8 #include "chrome/test/base/in_process_browser_test.h" | 8 #include "chrome/test/base/in_process_browser_test.h" |
| 9 #include "ui/base/ime/mock_input_method.h" | 9 #include "ui/base/ime/mock_input_method.h" |
| 10 #include "ui/base/ime/text_input_client.h" | 10 #include "ui/base/ime/text_input_client.h" |
| 11 #include "ui/gfx/range/range.h" | 11 #include "ui/gfx/range/range.h" |
| 12 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 class WebContents; | 15 class WebContents; |
| 16 } // namespace content | 16 } // namespace content |
| 17 | 17 |
| 18 namespace chromeos { | 18 namespace chromeos { |
| 19 | 19 |
| 20 // The base class of text input testing. | 20 // The base class of text input testing. |
| 21 class TextInputTestBase : public InProcessBrowserTest { | 21 class TextInputTestBase : public InProcessBrowserTest { |
| 22 public: | 22 public: |
| 23 TextInputTestBase() {} | 23 TextInputTestBase() {} |
| 24 virtual ~TextInputTestBase() {} | 24 virtual ~TextInputTestBase() {} |
| 25 | 25 |
| 26 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; | 26 virtual void SetUpInProcessBrowserTestFixture() override; |
| 27 private: | 27 private: |
| 28 DISALLOW_COPY_AND_ASSIGN(TextInputTestBase); | 28 DISALLOW_COPY_AND_ASSIGN(TextInputTestBase); |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 // Provides text input test utilities. | 31 // Provides text input test utilities. |
| 32 class TextInputTestHelper : public ui::InputMethodObserver { | 32 class TextInputTestHelper : public ui::InputMethodObserver { |
| 33 public: | 33 public: |
| 34 TextInputTestHelper(); | 34 TextInputTestHelper(); |
| 35 virtual ~TextInputTestHelper(); | 35 virtual ~TextInputTestHelper(); |
| 36 | 36 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 65 enum WaitImeEventType { | 65 enum WaitImeEventType { |
| 66 NO_WAIT, | 66 NO_WAIT, |
| 67 WAIT_ON_BLUR, | 67 WAIT_ON_BLUR, |
| 68 WAIT_ON_CARET_BOUNDS_CHANGED, | 68 WAIT_ON_CARET_BOUNDS_CHANGED, |
| 69 WAIT_ON_FOCUS, | 69 WAIT_ON_FOCUS, |
| 70 WAIT_ON_TEXT_INPUT_TYPE_CHANGED, | 70 WAIT_ON_TEXT_INPUT_TYPE_CHANGED, |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 // ui::InputMethodObserver overrides. | 73 // ui::InputMethodObserver overrides. |
| 74 virtual void OnTextInputTypeChanged( | 74 virtual void OnTextInputTypeChanged( |
| 75 const ui::TextInputClient* client) OVERRIDE; | 75 const ui::TextInputClient* client) override; |
| 76 virtual void OnFocus() OVERRIDE; | 76 virtual void OnFocus() override; |
| 77 virtual void OnBlur() OVERRIDE; | 77 virtual void OnBlur() override; |
| 78 virtual void OnCaretBoundsChanged(const ui::TextInputClient* client) OVERRIDE; | 78 virtual void OnCaretBoundsChanged(const ui::TextInputClient* client) override; |
| 79 virtual void OnTextInputStateChanged( | 79 virtual void OnTextInputStateChanged( |
| 80 const ui::TextInputClient* client) OVERRIDE; | 80 const ui::TextInputClient* client) override; |
| 81 virtual void OnShowImeIfNeeded() OVERRIDE; | 81 virtual void OnShowImeIfNeeded() override; |
| 82 virtual void OnInputMethodDestroyed( | 82 virtual void OnInputMethodDestroyed( |
| 83 const ui::InputMethod* input_method) OVERRIDE; | 83 const ui::InputMethod* input_method) override; |
| 84 | 84 |
| 85 // Represents waiting type of text input event. | 85 // Represents waiting type of text input event. |
| 86 WaitImeEventType waiting_type_; | 86 WaitImeEventType waiting_type_; |
| 87 | 87 |
| 88 base::string16 surrounding_text_; | 88 base::string16 surrounding_text_; |
| 89 gfx::Rect caret_rect_; | 89 gfx::Rect caret_rect_; |
| 90 gfx::Rect composition_head_; | 90 gfx::Rect composition_head_; |
| 91 gfx::Range selection_range_; | 91 gfx::Range selection_range_; |
| 92 bool focus_state_; | 92 bool focus_state_; |
| 93 ui::TextInputType latest_text_input_type_; | 93 ui::TextInputType latest_text_input_type_; |
| 94 | 94 |
| 95 DISALLOW_COPY_AND_ASSIGN(TextInputTestHelper); | 95 DISALLOW_COPY_AND_ASSIGN(TextInputTestHelper); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace chromeos | 98 } // namespace chromeos |
| 99 | 99 |
| 100 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_TEXTINPUT_TEST_HELPER_H_ | 100 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_TEXTINPUT_TEST_HELPER_H_ |
| OLD | NEW |