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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 2643503002: Adding a unit test to RenderWidgetHostViewAura (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698