Commit 83caea53 authored by tdresser's avatar tdresser Committed by Commit bot

Add smoothness test for hover during trackpad scrolling.

The results of this test will improve dramatically when
crbug.com/317007 is fixed.

BUG=317007

Review URL: https://codereview.chromium.org/1157093002

Cr-Commit-Position: refs/heads/master@{#333044}
parent 5d18b249
......@@ -289,6 +289,22 @@ bool BeginSmoothScroll(v8::Isolate* isolate,
if (!context.Init(false))
return false;
// Convert coordinates from CSS pixels to density independent pixels (DIPs).
float page_scale_factor = context.web_view()->pageScaleFactor();
if (gesture_source_type == SyntheticGestureParams::MOUSE_INPUT) {
// Ensure the mouse is centered and visible, in case it will
// trigger any hover or mousemove effects.
blink::WebRect contentRect =
context.web_view()->mainFrame()->visibleContentRect();
blink::WebMouseEvent mouseMove;
mouseMove.type = blink::WebInputEvent::MouseMove;
mouseMove.x = (contentRect.x + contentRect.width / 2) * page_scale_factor;
mouseMove.y = (contentRect.y + contentRect.height / 2) * page_scale_factor;
context.web_view()->handleInputEvent(mouseMove);
context.web_view()->setCursorVisibilityState(true);
}
scoped_refptr<CallbackAndContext> callback_and_context =
new CallbackAndContext(
isolate, callback, context.web_frame()->mainWorldScriptContext());
......@@ -296,9 +312,6 @@ bool BeginSmoothScroll(v8::Isolate* isolate,
scoped_ptr<SyntheticSmoothScrollGestureParams> gesture_params(
new SyntheticSmoothScrollGestureParams);
// Convert coordinates from CSS pixels to density independent pixels (DIPs).
float page_scale_factor = context.web_view()->pageScaleFactor();
if (gesture_source_type < 0 ||
gesture_source_type > SyntheticGestureParams::GESTURE_SOURCE_TYPE_MAX) {
return false;
......
......@@ -84,7 +84,7 @@ class GmailMouseScrollPage(KeyDesktopMoveCasesPage):
class GoogleMapsPage(KeyDesktopMoveCasesPage):
""" Why: productivity, top google properties; Supports drag gesturee """
""" Why: productivity, top google properties; Supports drag gestures """
def __init__(self, page_set):
super(GoogleMapsPage, self).__init__(
......
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.internal.actions import page_action
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class ToughFastScrollingCasesPage(page_module.Page):
def __init__(self, url, name, speed_in_pixels_per_second, page_set):
def __init__(self, url, name, speed_in_pixels_per_second, page_set,
synthetic_gesture_source):
super(ToughFastScrollingCasesPage, self).__init__(
url=url,
page_set=page_set,
name=name)
self.speed_in_pixels_per_second = speed_in_pixels_per_second
self.synthetic_gesture_source = synthetic_gesture_source
def RunPageInteractions(self, action_runner):
with action_runner.CreateGestureInteraction('ScrollAction'):
action_runner.ScrollPage(
direction='down',
speed_in_pixels_per_second=self.speed_in_pixels_per_second)
speed_in_pixels_per_second=self.speed_in_pixels_per_second,
synthetic_gesture_source=self.synthetic_gesture_source)
class ToughScrollingCasesPageSet(page_set_module.PageSet):
......@@ -31,6 +35,7 @@ class ToughScrollingCasesPageSet(page_set_module.PageSet):
fast_scrolling_page_name_list = [
'text',
'text_hover',
'canvas'
]
......@@ -40,8 +45,12 @@ class ToughScrollingCasesPageSet(page_set_module.PageSet):
for name in fast_scrolling_page_name_list:
for speed in fast_scrolling_speed_list:
synthetic_gesture_source = page_action.GESTURE_SOURCE_DEFAULT
if "hover" in name:
synthetic_gesture_source = page_action.GESTURE_SOURCE_MOUSE
self.AddUserStory(ToughFastScrollingCasesPage(
'file://tough_scrolling_cases/' + name + '.html',
name + '_' + str(speed).zfill(5) + '_pixels_per_second',
speed,
self))
self,
synthetic_gesture_source))
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment