Bug 1243415 - Add hash format support for screenshots in chrome scope. r=automatedtester a=test-only
authorHenrik Skupin <mail@hskupin.info>
Mon, 05 Dec 2016 23:06:36 +0100
changeset 353303 7b31d0beacbcdad77273ab9417f75f8593a2bf99
parent 353302 a7da8bdcf0f7cb64dc1d84ec6a8c5659aa1d324d
child 353304 88b2329f2448714081dd8074751fecbfdc96b3f6
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester, test-only
bugs1243415
milestone52.0a2
Bug 1243415 - Add hash format support for screenshots in chrome scope. r=automatedtester a=test-only MozReview-Commit-ID: Dp0vDyYTzX1
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2381,17 +2381,21 @@ GeckoDriver.prototype.takeScreenshot = f
       let highlightEls = [];
 
       for (let h of highlights) {
         let el = this.curBrowser.seenEls.get(h, container);
         highlightEls.push(el);
       }
 
       let canvas = capture.viewport(this.getCurrentWindow(), highlightEls);
-      return capture.toBase64(canvas);
+      if (hash) {
+        return capture.toHash(canvas);
+      } else {
+        return capture.toBase64(canvas);
+      }
 
     case Context.CONTENT:
       if (hash) {
         return this.listener.getScreenshotHash(id, full, highlights);
       } else {
         return this.listener.takeScreenshot(id, full, highlights);
       }
   }