Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(475)

Unified Diff: tools/telemetry/telemetry/page/actions/swipe.js

Issue 337643002: Add SwipePage/SwipeElement API to action_runner, wrapping over (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Guard test execution so that test doesn't fail in browser that doesn't support touch. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/page/actions/swipe.js
diff --git a/tools/telemetry/telemetry/page/actions/swipe.js b/tools/telemetry/telemetry/page/actions/swipe.js
index 023f7e729eb5a66f7763b1eb6409ad326ea2c55d..cf97d5cbbc9c43ad4b1bceecb311b2b95f8999fa 100644
--- a/tools/telemetry/telemetry/page/actions/swipe.js
+++ b/tools/telemetry/telemetry/page/actions/swipe.js
@@ -8,15 +8,15 @@
function SwipeGestureOptions(opt_options) {
if (opt_options) {
this.element_ = opt_options.element;
- this.left_start_percentage_ = opt_options.left_start_percentage;
- this.top_start_percentage_ = opt_options.top_start_percentage;
+ this.left_start_ratio_ = opt_options.left_start_ratio;
+ this.top_start_ratio_ = opt_options.top_start_ratio;
this.direction_ = opt_options.direction;
this.distance_ = opt_options.distance;
this.speed_ = opt_options.speed;
} else {
this.element_ = document.body;
- this.left_start_percentage_ = 0.5;
- this.top_start_percentage_ = 0.5;
+ this.left_start_ratio_ = 0.5;
+ this.top_start_ratio_ = 0.5;
this.direction_ = 'left';
this.distance_ = 0;
this.speed_ = 800;
@@ -52,9 +52,9 @@
var rect = __GestureCommon_GetBoundingVisibleRect(this.options_.element_);
var start_left =
- rect.left + rect.width * this.options_.left_start_percentage_;
+ rect.left + rect.width * this.options_.left_start_ratio_;
var start_top =
- rect.top + rect.height * this.options_.top_start_percentage_;
+ rect.top + rect.height * this.options_.top_start_ratio_;
chrome.gpuBenchmarking.swipe(this.options_.direction_,
this.options_.distance_,
this.onGestureComplete_.bind(this),
« no previous file with comments | « tools/telemetry/telemetry/page/actions/action_runner_unittest.py ('k') | tools/telemetry/telemetry/page/actions/swipe.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698