Chromium Code Reviews| Index: content/browser/web_contents/touch_editable_impl_aura_browsertest.cc |
| diff --git a/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc b/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc |
| index a35f28165b3f3bb03f23e7cafbb5cdab9012117b..86ffd26fcd798a394fffb1e1532d30d106b64fd4 100644 |
| --- a/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc |
| +++ b/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc |
| @@ -25,6 +25,7 @@ |
| #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| #include "ui/events/event_utils.h" |
| #include "ui/events/test/event_generator.h" |
| +#include "ui/wm/core/default_screen_position_client.h" |
| using blink::WebInputEvent; |
| @@ -49,8 +50,9 @@ class TestTouchEditableImplAura : public TouchEditableImplAura { |
| waiting_for_fling_stop_callback_ = false; |
| } |
| - virtual void OnSelectionOrCursorChanged(const gfx::Rect& anchor, |
| - const gfx::Rect& focus) override { |
| + virtual void OnSelectionOrCursorChanged( |
| + const ui::SelectionBound& anchor, |
| + const ui::SelectionBound& focus) override { |
| selection_changed_callback_arrived_ = true; |
| TouchEditableImplAura::OnSelectionOrCursorChanged(anchor, focus); |
| if (waiting_for_selection_changed_callback_) |
| @@ -138,6 +140,8 @@ class TouchEditableImplAuraTest : public ContentBrowserTest { |
| NavigateToURL(shell(), test_url); |
| aura::Window* content = shell()->web_contents()->GetContentNativeView(); |
| content->GetHost()->SetBounds(gfx::Rect(800, 600)); |
| + aura::client::SetScreenPositionClient( |
| + content->GetRootWindow(), &screen_position_client_); |
|
mohsen
2014/11/07 16:52:27
Can you move this to SetUp()? (the same for simila
mfomitchev
2014/11/10 04:04:11
Done.
|
| } |
| RenderWidgetHostViewAura* GetRenderWidgetHostViewAura( |
| @@ -155,6 +159,8 @@ class TouchEditableImplAuraTest : public ContentBrowserTest { |
| } |
| private: |
| + wm::DefaultScreenPositionClient screen_position_client_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(TouchEditableImplAuraTest); |
| }; |
| @@ -193,9 +199,13 @@ IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest, |
| // Lets move the handles a bit to modify the selection |
| touch_editable->Reset(); |
| + ui::SelectionBound anchor, focus; |
| + touch_editable->GetSelectionEndPoints(&anchor, &focus); |
| + int handle_grab_x = bounds.x() + anchor.edge_bottom.x(); |
| + int handle_grab_y = bounds.y() + anchor.edge_bottom.y() + 1; |
| generator.GestureScrollSequence( |
| - gfx::Point(10, 47), |
| - gfx::Point(30, 47), |
| + gfx::Point(handle_grab_x, handle_grab_y), |
| + gfx::Point(handle_grab_x + 20, handle_grab_y), |
| base::TimeDelta::FromMilliseconds(20), |
| 5); |
| touch_editable->WaitForSelectionChangeCallback(); |