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 1abfc0b557fb0e515469d772a9103bd2d2a0ad9d..7652b2e168ea8cc4f859cf00e84e8ed8ac7429d7 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 |
| @@ -4750,4 +4750,19 @@ TEST_F(InputMethodStateAuraTest, SelectedTextCopiedToClipboard) { |
| } |
| #endif |
| +// This test verifies that when any view on the page cancels an ongoing |
| +// composition, the RenderWidgetHostViewAura will receive the notification and |
| +// the current composition is canceled. |
| +TEST_F(InputMethodStateAuraTest, ImeCancelCompositionForAllViews) { |
| + for (auto* view : views_) { |
| + ActivateViewForTextInputManager(view, ui::TEXT_INPUT_TYPE_TEXT); |
| + // There is no composition in the beginning. |
| + EXPECT_FALSE(has_composition_text()); |
| + SetHasCompositionTextToTrue(); |
| + view->ImeCancelComposition(); |
|
Charlie Reis
2017/01/17 22:31:38
nit: Put EXPECT_TRUE(has_composition_text()) befor
EhsanK
2017/01/17 22:45:47
It will definitely help with readability of the te
Charlie Reis
2017/01/17 22:49:20
Oh, I didn't see that before. It's ok as is then.
|
| + // The composition must have been canceled. |
| + EXPECT_FALSE(has_composition_text()); |
| + } |
| +} |
| + |
| } // namespace content |