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

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

Issue 2903833002: Reland: Update TextSelection for non-user initiated events
Patch Set: Add test for JS cursor movement Created 3 years, 5 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
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 75e336cf3c7680262642cc2e5a0e5feb5f6d3d12..44bcf986ac3d5de7abee60048b172c7adb37c949 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
@@ -6142,7 +6142,7 @@ TEST_F(InputMethodStateAuraTest, GetSelectedText) {
for (auto index : active_view_sequence_) {
render_widget_host_delegate()->set_focused_widget(
RenderWidgetHostImpl::From(views_[index]->GetRenderWidgetHost()));
- views_[index]->SelectionChanged(text, offset, selection_range);
+ views_[index]->SelectionChanged(text, offset, selection_range, true);
base::string16 expected_text = text.substr(
selection_range.GetMin() - offset, selection_range.length());
@@ -6164,7 +6164,7 @@ TEST_F(InputMethodStateAuraTest, GetTextRange) {
render_widget_host_delegate()->set_focused_widget(
RenderWidgetHostImpl::From(views_[index]->GetRenderWidgetHost()));
gfx::Range expected_range(offset, offset + text.length());
- views_[index]->SelectionChanged(text, offset, selection_range);
+ views_[index]->SelectionChanged(text, offset, selection_range, true);
gfx::Range range_from_client;
// For aura this always returns true.
@@ -6185,7 +6185,7 @@ TEST_F(InputMethodStateAuraTest, GetSelectionRange) {
for (auto index : active_view_sequence_) {
render_widget_host_delegate()->set_focused_widget(
RenderWidgetHostImpl::From(views_[index]->GetRenderWidgetHost()));
- views_[index]->SelectionChanged(text, 0U, expected_range);
+ views_[index]->SelectionChanged(text, 0U, expected_range, true);
gfx::Range range_from_client;
// This method always returns true.
@@ -6215,7 +6215,7 @@ TEST_F(InputMethodStateAuraTest, SelectedTextCopiedToClipboard) {
// Change the selection of the currently focused widget. It suffices to just
// call the method on the view.
base::string16 expected_text = base::ASCIIToUTF16(texts[index]);
- views_[index]->SelectionChanged(expected_text, 0U, gfx::Range(0, 5));
+ views_[index]->SelectionChanged(expected_text, 0U, gfx::Range(0, 5), true);
// Retrieve the selected text from clipboard and verify it is as expected.
base::string16 result_text;

Powered by Google App Engine
This is Rietveld 408576698