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

Unified Diff: tools/telemetry/telemetry/internal/actions/gesture_common.js

Issue 1400213002: Update telemetry tests that rely on window.innerWidth/Height. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Worked on review comments Created 5 years, 2 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
« no previous file with comments | « third_party/WebKit/public/web/WebView.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/internal/actions/gesture_common.js
diff --git a/tools/telemetry/telemetry/internal/actions/gesture_common.js b/tools/telemetry/telemetry/internal/actions/gesture_common.js
index 2e17fa2b69e81fb7f7ccecebc1573a7f27c4d421..9522f65c2e838cdbf2cff89e0a7b9e39bb50343d 100644
--- a/tools/telemetry/telemetry/internal/actions/gesture_common.js
+++ b/tools/telemetry/telemetry/internal/actions/gesture_common.js
@@ -39,8 +39,18 @@
rect.left = 0;
}
- var outsideHeight = (rect.top + rect.height) - window.innerHeight;
- var outsideWidth = (rect.left + rect.width) - window.innerWidth;
+ // TODO(ymalik): Remove the fallback path once the visualViewportHeight and
+ // visualViewportWidth properties roll into stable.
+ var visualViewportHeight = window.innerHeight;
+ var visualViewportWidth = window.innerWidth;
+ if (chrome.gpuBenchmarking.visualViewportHeight) {
+ visualViewportHeight = chrome.gpuBenchmarking.visualViewportHeight();
+ }
+ if (chrome.gpuBenchmarking.visualViewportWidth) {
+ visualViewportWidth = chrome.gpuBenchmarking.visualViewportWidth();
+ }
+ var outsideHeight = (rect.top + rect.height) - visualViewportHeight;
+ var outsideWidth = (rect.left + rect.width) - visualViewportWidth;
if (outsideHeight > 0) {
rect.height -= outsideHeight;
« no previous file with comments | « third_party/WebKit/public/web/WebView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698