Bug 1531417 - fix marionette test. r=me CLOSED TREE
authorLee Salzman <lsalzman@mozilla.com>
Fri, 01 Mar 2019 16:40:58 -0500
changeset 519993 e2a5031c85cd9c7bb7c87c8afe4510bc3711c436
parent 519992 5e4d951c88fdaf4a2be82dc8b855fbd5fd4f3644
child 519994 7497f62741416da24f15c59a6a01d3a64953ca86
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1531417
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1531417 - fix marionette test. r=me CLOSED TREE
testing/marionette/capture.js
--- a/testing/marionette/capture.js
+++ b/testing/marionette/capture.js
@@ -128,16 +128,23 @@ capture.canvas = function(win, left, top
       canvasHeight = MAX_SKIA_DIMENSIONS;
     }
 
     canvas = win.document.createElementNS(XHTML_NS, "canvas");
     canvas.width = canvasWidth;
     canvas.height = canvasHeight;
   }
 
+  if (width * scale > MAX_SKIA_DIMENSIONS) {
+    width = Math.floor(MAX_SKIA_DIMENSIONS / scale);
+  }
+  if (height * scale > MAX_SKIA_DIMENSIONS) {
+    height = Math.floor(MAX_SKIA_DIMENSIONS / scale);
+  }
+
   let ctx = canvas.getContext(CONTEXT_2D);
   if (flags === null) {
     flags = ctx.DRAWWINDOW_DRAW_CARET;
     // TODO(ato): https://bugzil.la/1377335
     //
     // Disabled in bug 1243415 for webplatform-test
     // failures due to out of view elements.  Needs
     // https://github.com/w3c/web-platform-tests/issues/4383 fixed.