summaryrefslogtreecommitdiffstats
path: root/tools/telemetry
diff options
context:
space:
mode:
authordominikg@chromium.org <dominikg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-21 17:47:35 +0000
committerdominikg@chromium.org <dominikg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-21 17:47:35 +0000
commit9017d7856ea1f59a673ec8fcfd468674b4a2c008 (patch)
treed6a2defff791ff5c294bd6367401db7a481812a7 /tools/telemetry
parent9a67241862c036c172eca8b81f2e717b616471ae (diff)
downloadchromium_src-9017d7856ea1f59a673ec8fcfd468674b4a2c008.zip
chromium_src-9017d7856ea1f59a673ec8fcfd468674b4a2c008.tar.gz
chromium_src-9017d7856ea1f59a673ec8fcfd468674b4a2c008.tar.bz2
Replace old with new synthetic gesture framework.
- Remove current implementation of synthetic gestures. - Rename temporarily named classes and files of new synthetic gesture framework (e.g. SyntheticGestureNew -> SyntheticGesture). - Link up new implementation in browser and renderer. - Hook up synthetic gesture controller to input flushing in RWHI. - Update JavaScript front-end and Telemetry. BUG=297980 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=236254 Review URL: https://codereview.chromium.org/62443007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/telemetry')
-rw-r--r--tools/telemetry/telemetry/page/actions/scroll.js4
-rw-r--r--tools/telemetry/telemetry/page/actions/scroll.py16
2 files changed, 15 insertions, 5 deletions
diff --git a/tools/telemetry/telemetry/page/actions/scroll.js b/tools/telemetry/telemetry/page/actions/scroll.js
index e68d91a..218fae0 100644
--- a/tools/telemetry/telemetry/page/actions/scroll.js
+++ b/tools/telemetry/telemetry/page/actions/scroll.js
@@ -16,10 +16,12 @@
this.element_ = opt_options.element;
this.left_start_percentage_ = opt_options.left_start_percentage;
this.top_start_percentage_ = opt_options.top_start_percentage;
+ this.gesture_source_type = opt_options.gesture_source_type;
} else {
this.element_ = document.body;
this.left_start_percentage_ = 0.5;
this.top_start_percentage_ = 0.5;
+ this.gesture_source_type = chrome.gpuBenchmarking.DEFAULT_INPUT;
}
}
@@ -73,7 +75,7 @@
rect.top + rect.height * this.options_.top_start_percentage_;
chrome.gpuBenchmarking.smoothScrollBy(distance, function() {
callback();
- }, start_left, start_top);
+ }, start_left, start_top, this.options_.gesture_source_type);
};
// This class scrolls a page from the top to the bottom once.
diff --git a/tools/telemetry/telemetry/page/actions/scroll.py b/tools/telemetry/telemetry/page/actions/scroll.py
index f3106ec..26cddf7 100644
--- a/tools/telemetry/telemetry/page/actions/scroll.py
+++ b/tools/telemetry/telemetry/page/actions/scroll.py
@@ -21,6 +21,8 @@ class ScrollAction(page_action.PageAction):
'Synthetic scroll not supported for this browser')
# Fail if this action requires touch and we can't send touch events.
+ # TODO(dominikg): Query synthetic gesture target to check if touch is
+ # supported.
if (hasattr(self, 'scroll_requires_touch') and
self.scroll_requires_touch and not
tab.EvaluateJavaScript(
@@ -46,26 +48,32 @@ class ScrollAction(page_action.PageAction):
# }
left_start_percentage = 0.5
top_start_percentage = 0.5
+ gesture_source_type = 'chrome.gpuBenchmarking.DEFAULT_INPUT'
if hasattr(self, 'left_start_percentage'):
left_start_percentage = self.left_start_percentage
if hasattr(self, 'top_start_percentage'):
top_start_percentage = self.top_start_percentage
+ if hasattr(self, 'scroll_requires_touch') and self.scroll_requires_touch:
+ gesture_source_type = 'chrome.gpuBenchmarking.TOUCH_INPUT'
if hasattr(self, 'scrollable_element_function'):
tab.ExecuteJavaScript("""
(%s)(function(element) { window.__scrollAction.start(
{ element: element,
left_start_percentage: %s,
- top_start_percentage: %s })
+ top_start_percentage: %s,
+ gesture_source_type: %s })
});""" % (self.scrollable_element_function,
left_start_percentage,
- top_start_percentage))
+ top_start_percentage,
+ gesture_source_type))
else:
tab.ExecuteJavaScript("""
window.__scrollAction.start(
{ element: document.body,
left_start_percentage: %s,
- top_start_percentage: %s });"""
- % (left_start_percentage, top_start_percentage))
+ top_start_percentage: %s,
+ gesture_source_type: %s });"""
+ % (left_start_percentage, top_start_percentage, gesture_source_type))
tab.WaitForJavaScriptExpression('window.__scrollActionDone', 60)