Re: [chromium-dev] SimulateGestureScrollSequence didn't work for textarea in browser test

5 views
Skip to first unread message

Tim Dresser

unread,
Nov 13, 2017, 8:05:44 AM11/13/17
to apis...@yandex-team.ru, input-dev
-chromium-dev 
+input-dev 

On Wed, Nov 8, 2017 at 4:18 AM Alexander Pisarev <apis...@yandex-team.ru> wrote:
Hello everyone,

I added next text to chrome/browser/chrome_site_per_process_browsertest.cc (maybe not best place for it but nevertheless):
IN_PROC_BROWSER_TEST_F(ChromeSitePerProcessTest, SmallTextareaScroll) {
  ui_test_utils
::NavigateToURL(
      browser
(), GURL(embedded_test_server()->GetURL(
                     
"a.com", "/small_textarea_with_scroll.html")));

  content
::WebContents* web_contents =
      browser
()->tab_strip_model()->GetActiveWebContents();

 
auto* rwhv = web_contents->GetRenderWidgetHostView();

  gfx
::Rect bounds = rwhv->GetViewBounds();
  gfx
::Point pos(bounds.x() + 10, bounds.y() + 10);

 
float gesture_distance = 15.;

  content
::SimulateGestureScrollSequence(web_contents, pos,
                                         gfx
::Vector2dF(0., -gesture_distance));

  std
::string get_textarea_scroll_offset_y(
     
"window.domAutomationController.send("
     
"    document.getElementById('area').scrollTop);");

 
double offset_x = 0.;
 
while (offset_x != gesture_distance) {
    ASSERT_TRUE
(ExecuteScriptAndExtractDouble(
        web_contents
, get_textarea_scroll_offset_y, &offset_x));
   
base::RunLoop().RunUntilIdle();
 
}
}
 
And here is HTML file chrome/test/data/small_textarea_with_scroll.html:

<html>
<body>
<textarea id="area" rows="2">
1
2
3
4
5
6
7
8
9
</textarea>
</body>
</html>

This test should scroll textarea, but nothing happens. I think it caused by not initialized ScrollNode. If be more precisely non fast scrollable region is empty, but it must contain area rects.
Is it a bug or not? Can someone help me with this?
Maybe I should insert some waiter? But what kind of it?

Many thanks.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/be508a6c-406a-4aa2-80ca-59b0ff187fbf%40chromium.org.

Timothy Dresser

unread,
Nov 13, 2017, 8:06:26 AM11/13/17
to apis...@yandex-team.ru, inpu...@chromium.org
Reply all
Reply to author
Forward
0 new messages