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

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

Issue 573963005: Clean up GestureEventDetails constructors and fix unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update the patch Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 RenderWidgetHostViewAura* rwhva = static_cast<RenderWidgetHostViewAura*>( 333 RenderWidgetHostViewAura* rwhva = static_cast<RenderWidgetHostViewAura*>(
334 web_contents->GetRenderWidgetHostView()); 334 web_contents->GetRenderWidgetHostView());
335 EXPECT_EQ(GetRenderWidgetHostViewAura(touch_editable), rwhva); 335 EXPECT_EQ(GetRenderWidgetHostViewAura(touch_editable), rwhva);
336 336
337 // Long press to select word. 337 // Long press to select word.
338 ui::GestureEvent long_press( 338 ui::GestureEvent long_press(
339 10, 339 10,
340 10, 340 10,
341 0, 341 0,
342 ui::EventTimeForNow(), 342 ui::EventTimeForNow(),
343 ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS, 0, 0)); 343 ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS));
344 touch_editable->Reset(); 344 touch_editable->Reset();
345 rwhva->OnGestureEvent(&long_press); 345 rwhva->OnGestureEvent(&long_press);
346 touch_editable->WaitForSelectionChangeCallback(); 346 touch_editable->WaitForSelectionChangeCallback();
347 347
348 // Check if selection handles are showing. 348 // Check if selection handles are showing.
349 EXPECT_TRUE(GetTouchSelectionController(touch_editable)); 349 EXPECT_TRUE(GetTouchSelectionController(touch_editable));
350 350
351 scoped_ptr<base::Value> value = 351 scoped_ptr<base::Value> value =
352 content::ExecuteScriptAndGetValue(main_frame, "get_selection()"); 352 content::ExecuteScriptAndGetValue(main_frame, "get_selection()");
353 std::string selection; 353 std::string selection;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 value = content::ExecuteScriptAndGetValue(main_frame, 442 value = content::ExecuteScriptAndGetValue(main_frame,
443 "get_cursor_position()"); 443 "get_cursor_position()");
444 int new_cursor_pos = -1; 444 int new_cursor_pos = -1;
445 value->GetAsInteger(&new_cursor_pos); 445 value->GetAsInteger(&new_cursor_pos);
446 EXPECT_NE(-1, new_cursor_pos); 446 EXPECT_NE(-1, new_cursor_pos);
447 // Cursor should have moved. 447 // Cursor should have moved.
448 EXPECT_NE(new_cursor_pos, cursor_pos); 448 EXPECT_NE(new_cursor_pos, cursor_pos);
449 } 449 }
450 450
451 } // namespace content 451 } // namespace content
OLDNEW
« 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