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

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

Issue 346923003: Add ActionRunner wrapper for the remaining less used actions (try 2): (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update unit test to skip test if touch is not supported. Created 6 years, 5 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/pinch.js
diff --git a/tools/telemetry/telemetry/page/actions/pinch.js b/tools/telemetry/telemetry/page/actions/pinch.js
index 6e3e6017088005139ca9fe171e92997930c592b5..bdada3aa154695e306a269ebb5f086323d892584 100644
--- a/tools/telemetry/telemetry/page/actions/pinch.js
+++ b/tools/telemetry/telemetry/page/actions/pinch.js
@@ -13,14 +13,14 @@
function PinchGestureOptions(opt_options) {
if (opt_options) {
this.element_ = opt_options.element;
- this.left_anchor_percentage_ = opt_options.left_anchor_percentage;
- this.top_anchor_percentage_ = opt_options.top_anchor_percentage;
+ this.left_anchor_ratio_ = opt_options.left_anchor_ratio;
+ this.top_anchor_ratio_ = opt_options.top_anchor_ratio;
this.scale_factor_ = opt_options.scale_factor;
this.speed_ = opt_options.speed;
} else {
this.element_ = document.body;
- this.left_anchor_percentage_ = 0.5;
- this.top_anchor_percentage_ = 0.5;
+ this.left_anchor_ratio_ = 0.5;
+ this.top_anchor_ratio_ = 0.5;
this.scale_factor_ = 2.0;
this.speed_ = 800;
}
@@ -54,9 +54,9 @@
var rect = __GestureCommon_GetBoundingVisibleRect(this.options_.element_);
var anchor_left =
- rect.left + rect.width * this.options_.left_anchor_percentage_;
+ rect.left + rect.width * this.options_.left_anchor_ratio_;
var anchor_top =
- rect.top + rect.height * this.options_.top_anchor_percentage_;
+ rect.top + rect.height * this.options_.top_anchor_ratio_;
chrome.gpuBenchmarking.pinchBy(this.options_.scale_factor_,
anchor_left, anchor_top,
this.onGestureComplete_.bind(this),
« no previous file with comments | « tools/telemetry/telemetry/page/actions/loop_unittest.py ('k') | tools/telemetry/telemetry/page/actions/pinch.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698