OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |