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

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: Suppress superfluous non-user initiated text selection events Created 3 years, 6 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 f915f1d6dc5c7a0e8b8ce8d56ff8516f5b481acb..8ac140adf9f4122800586dee4adaf12b2312eba9 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
@@ -5743,7 +5743,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());
@@ -5765,7 +5765,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.
@@ -5786,7 +5786,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.
@@ -5816,7 +5816,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