Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc |
| index 30defc8652ebd6e26f713df9a26c93555bf04233..a1c878788101f5107ed7e48ba00ebcf806a93130 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc |
| +++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc |
| @@ -4300,4 +4300,24 @@ TEST_F(InputMethodStateAuraTest, GetCaretBounds) { |
| } |
| } |
| +// This test activates child frames in a specific sequence and changes their |
| +// composition range. Then it verifies that the ui::TextInputClient returns the |
| +// correct character bound at the given indices. |
| +TEST_F(InputMethodStateAuraTest, GetCompositionCharacterBounds) { |
| + gfx::Rect bound; |
| + // Initially, there should be no bounds. |
| + EXPECT_FALSE(text_input_client()->GetCompositionCharacterBounds(0, &bound)); |
| + for (auto index : active_view_sequence_) { |
| + ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT); |
| + // Simulate an IPC to set character bounds for the view. |
| + views_[index]->ImeCompositionRangeChanged(gfx::Range(), |
| + {gfx::Rect(1, 2, 3, 4 + index)}); |
| + // No bounds at index 1. |
| + EXPECT_FALSE(text_input_client()->GetCompositionCharacterBounds(1, &bound)); |
| + // valid bound at index 0. |
|
Charlie Reis
2016/07/08 18:55:24
nit: Valid
EhsanK
2016/07/11 18:07:21
Done.
|
| + EXPECT_TRUE(text_input_client()->GetCompositionCharacterBounds(0, &bound)); |
| + EXPECT_EQ(4 + (int) index, bound.height()); |
| + } |
| +} |
| + |
| } // namespace content |