Bug 1380659 - Add TalowPowersService commands to reset/dump coverage counters. r=jmaher
authorMarco Castelluccio <mcastelluccio@mozilla.com>
Fri, 14 Jul 2017 19:23:17 +0200
changeset 419212 97f0052a4bf942cefef28b1c90e7889e7af432be
parent 419211 5b5f72590fc265bb341fda3fb12fe1ae075ec48b
child 419213 9e581da5ec7fa7ea0d3d03e867d4efb5a1fc6889
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1380659
milestone56.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 1380659 - Add TalowPowersService commands to reset/dump coverage counters. r=jmaher
testing/talos/talos/talos-powers/components/TalosPowersService.js
--- a/testing/talos/talos/talos-powers/components/TalosPowersService.js
+++ b/testing/talos/talos/talos-powers/components/TalosPowersService.js
@@ -1,13 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-const { interfaces: Ci, utils: Cu } = Components;
+const { interfaces: Ci, utils: Cu, classes: Cc } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
   "resource://gre/modules/osfile.jsm");
 
 const FRAME_SCRIPT = "chrome://talos-powers/content/talos-powers-content.js";
@@ -290,16 +290,30 @@ TalosPowersService.prototype = {
 
     // arg: handle from startFrameTimeRecording. return: array with composition intervals
     stopFrameTimeRecording(arg, callback, win) {
       var rv = win.QueryInterface(Ci.nsIInterfaceRequestor)
                   .getInterface(Ci.nsIDOMWindowUtils)
                   .stopFrameTimeRecording(arg);
       callback(rv);
     },
+
+    requestDumpCoverageCounters(arg, callback, win) {
+      let codeCoverage = Cc["@mozilla.org/tools/code-coverage;1"].
+                         getService(Ci.nsICodeCoverage);
+      codeCoverage.dumpCounters();
+      callback();
+    },
+
+    requestResetCoverageCounters(arg, callback, win) {
+      let codeCoverage = Cc["@mozilla.org/tools/code-coverage;1"].
+                         getService(Ci.nsICodeCoverage);
+      codeCoverage.resetCounters();
+      callback();
+    },
   },
 
   RecieveParentExecCommand(msg) {
     function sendResult(result) {
       let mm = msg.target.messageManager;
       mm.sendAsyncMessage("TalosPowers:ParentExec:ReplyMsg", {
         id: msg.data.id,
         result