Bug 1341476 - Make the dump-dmd-after-test mochitest option work again. r=jmaher
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 23 Feb 2017 19:36:08 -0500
changeset 373571 165111e8940e9bd2285becfbde5755b488650584
parent 373570 f95acc1bb74ed29c86d2fe688c4a65e8ba00821d
child 373572 6559514972f54076f719cc172313f02321c68ed4
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1341476
milestone54.0a1
Bug 1341476 - Make the dump-dmd-after-test mochitest option work again. r=jmaher MozReview-Commit-ID: 85oqrrzyYUR
testing/mochitest/mochitest_options.py
testing/mochitest/tests/SimpleTest/MemoryStats.js
--- a/testing/mochitest/mochitest_options.py
+++ b/testing/mochitest/mochitest_options.py
@@ -472,18 +472,20 @@ class MochitestArguments(ArgumentContain
           "dest": "dumpAboutMemoryAfterTest",
           "help": "Dump an about:memory log after each test in the directory specified "
                   "by --dump-output-directory.",
           }],
         [["--dump-dmd-after-test"],
          {"action": "store_true",
           "default": False,
           "dest": "dumpDMDAfterTest",
-          "help": "Dump a DMD log after each test in the directory specified "
-                  "by --dump-output-directory.",
+          "help": "Dump a DMD log (and an accompanying about:memory log) after each test. "
+                  "These will be dumped into your default temp directory, NOT the directory "
+                  "specified by --dump-output-directory. The logs are numbered by test, and "
+                  "each test will include output that indicates the DMD output filename.",
           }],
         [["--screenshot-on-fail"],
          {"action": "store_true",
           "default": False,
           "dest": "screenshotOnFail",
           "help": "Take screenshots on all test failures. Set $MOZ_UPLOAD_DIR to a directory "
                   "for storing the screenshots."
           }],
--- a/testing/mochitest/tests/SimpleTest/MemoryStats.js
+++ b/testing/mochitest/tests/SimpleTest/MemoryStats.js
@@ -98,25 +98,16 @@ MemoryStats.dump = function (testNumber,
         info(testURL + " | MEMDUMP-START " + dumpfile);
         var md = MemoryStats._getService("@mozilla.org/memory-info-dumper;1",
                                          "nsIMemoryInfoDumper");
         md.dumpMemoryReportsToNamedFile(dumpfile, function () {
             info("TEST-INFO | " + testURL + " | MEMDUMP-END");
         }, null, /* anonymize = */ false);
     }
 
-    // This is the old, deprecated function.
-    if (dumpDMD && typeof(DMDReportAndDump) != "undefined") {
-        var basename = "dmd-" + testNumber + "-deprecated.txt";
-        var dumpfile = MemoryStats.constructPathname(dumpOutputDirectory,
-                                                     basename);
-        info(testURL + " | DMD-DUMP-deprecated " + dumpfile);
-        DMDReportAndDump(dumpfile);
-    }
-
-    if (dumpDMD && typeof(DMDAnalyzeReports) != "undefined") {
-        var basename = "dmd-" + testNumber + ".txt";
-        var dumpfile = MemoryStats.constructPathname(dumpOutputDirectory,
-                                                     basename);
-        info(testURL + " | DMD-DUMP " + dumpfile);
-        DMDAnalyzeReports(dumpfile);
+    if (dumpDMD) {
+        var md = MemoryStats._getService("@mozilla.org/memory-info-dumper;1",
+                                         "nsIMemoryInfoDumper");
+        md.dumpMemoryInfoToTempDir(String(testNumber),
+                                   /* anonymize = */ false,
+                                   /* minimize memory usage = */ false);
     }
 };