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

Unified Diff: content/renderer/gpu/gpu_benchmarking_extension.cc

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 | « content/renderer/gpu/gpu_benchmarking_extension.h ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/gpu_benchmarking_extension.cc
diff --git a/content/renderer/gpu/gpu_benchmarking_extension.cc b/content/renderer/gpu/gpu_benchmarking_extension.cc
index 454f5f5e5f9410e66312c0a7fc2d371037f1d691..2bfce62e9edfb8dc52f034480dd7f99cca307cfc 100644
--- a/content/renderer/gpu/gpu_benchmarking_extension.cc
+++ b/content/renderer/gpu/gpu_benchmarking_extension.cc
@@ -456,6 +456,8 @@ gin::ObjectTemplateBuilder GpuBenchmarking::GetObjectTemplateBuilder(
// stable.
.SetValue("newPinchInterface", true)
.SetMethod("pinchBy", &GpuBenchmarking::PinchBy)
+ .SetMethod("visualViewportHeight", &GpuBenchmarking::VisualViewportHeight)
+ .SetMethod("visualViewportWidth", &GpuBenchmarking::VisualViewportWidth)
.SetMethod("tap", &GpuBenchmarking::Tap)
.SetMethod("clearImageCache", &GpuBenchmarking::ClearImageCache)
.SetMethod("runMicroBenchmark", &GpuBenchmarking::RunMicroBenchmark)
@@ -744,6 +746,20 @@ bool GpuBenchmarking::PinchBy(gin::Arguments* args) {
return true;
}
+float GpuBenchmarking::VisualViewportHeight() {
+ GpuBenchmarkingContext context;
+ if (!context.Init(false))
+ return 0.0;
+ return context.web_view()->visualViewportSize().height;
+}
+
+float GpuBenchmarking::VisualViewportWidth() {
+ GpuBenchmarkingContext context;
+ if (!context.Init(false))
+ return 0.0;
+ return context.web_view()->visualViewportSize().width;
+}
+
bool GpuBenchmarking::Tap(gin::Arguments* args) {
GpuBenchmarkingContext context;
if (!context.Init(false))
« no previous file with comments | « content/renderer/gpu/gpu_benchmarking_extension.h ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698