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.