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

Side by Side Diff: content/browser/web_contents/touch_editable_impl_aura_browsertest.cc

Issue 759433002: Reland: Move TouchSelectionController from content to ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Excluded ui/touch_selection from Windows GN build Created 6 years 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 unified diff | Download patch
« no previous file with comments | « content/browser/web_contents/touch_editable_impl_aura.cc ('k') | content/content.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/touch_editable_impl_aura.h" 5 #include "content/browser/web_contents/touch_editable_impl_aura.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 value->GetAsString(&selection); 197 value->GetAsString(&selection);
198 198
199 // Check if selection handles are showing. 199 // Check if selection handles are showing.
200 EXPECT_TRUE(GetTouchSelectionController(touch_editable)); 200 EXPECT_TRUE(GetTouchSelectionController(touch_editable));
201 EXPECT_STREQ("Some text we can select", selection.c_str()); 201 EXPECT_STREQ("Some text we can select", selection.c_str());
202 202
203 // Lets move the handles a bit to modify the selection 203 // Lets move the handles a bit to modify the selection
204 touch_editable->Reset(); 204 touch_editable->Reset();
205 ui::SelectionBound anchor, focus; 205 ui::SelectionBound anchor, focus;
206 touch_editable->GetSelectionEndPoints(&anchor, &focus); 206 touch_editable->GetSelectionEndPoints(&anchor, &focus);
207 int handle_grab_x = bounds.x() + anchor.edge_bottom.x(); 207 int handle_grab_x = bounds.x() + anchor.edge_bottom_rounded().x();
208 int handle_grab_y = bounds.y() + anchor.edge_bottom.y() + 1; 208 int handle_grab_y = bounds.y() + anchor.edge_bottom_rounded().y() + 1;
209 generator.GestureScrollSequence( 209 generator.GestureScrollSequence(
210 gfx::Point(handle_grab_x, handle_grab_y), 210 gfx::Point(handle_grab_x, handle_grab_y),
211 gfx::Point(handle_grab_x + 20, handle_grab_y), 211 gfx::Point(handle_grab_x + 20, handle_grab_y),
212 base::TimeDelta::FromMilliseconds(20), 212 base::TimeDelta::FromMilliseconds(20),
213 5); 213 5);
214 touch_editable->WaitForSelectionChangeCallback(); 214 touch_editable->WaitForSelectionChangeCallback();
215 215
216 EXPECT_TRUE(GetTouchSelectionController(touch_editable)); 216 EXPECT_TRUE(GetTouchSelectionController(touch_editable));
217 value = content::ExecuteScriptAndGetValue(main_frame, "get_selection()"); 217 value = content::ExecuteScriptAndGetValue(main_frame, "get_selection()");
218 value->GetAsString(&selection); 218 value->GetAsString(&selection);
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 value = content::ExecuteScriptAndGetValue(main_frame, 455 value = content::ExecuteScriptAndGetValue(main_frame,
456 "get_cursor_position()"); 456 "get_cursor_position()");
457 int new_cursor_pos = -1; 457 int new_cursor_pos = -1;
458 value->GetAsInteger(&new_cursor_pos); 458 value->GetAsInteger(&new_cursor_pos);
459 EXPECT_NE(-1, new_cursor_pos); 459 EXPECT_NE(-1, new_cursor_pos);
460 // Cursor should have moved. 460 // Cursor should have moved.
461 EXPECT_NE(new_cursor_pos, cursor_pos); 461 EXPECT_NE(new_cursor_pos, cursor_pos);
462 } 462 }
463 463
464 } // namespace content 464 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/touch_editable_impl_aura.cc ('k') | content/content.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698