Bug 1435296 Clean 0ms durations in stub generation r?nchevobbe draft
authorTom Ritter <tom@mozilla.com>
Fri, 09 Feb 2018 19:31:52 -0600
changeset 753922 eff79385bb51755fc00a019688de44d27dc09af0
parent 753921 a3c8d0bec6d60e232680a4aaa18311a419f66ba5
child 753923 4581ef36baae70079c0f833aea7548cb450755c5
push id98722
push userbmo:tom@mozilla.com
push dateMon, 12 Feb 2018 17:42:43 +0000
reviewersnchevobbe
bugs1435296
milestone60.0a1
Bug 1435296 Clean 0ms durations in stub generation r?nchevobbe If the duration was 0ms, it would not be cleaned; and thus lead to a mismatch and ultimately test failure. MozReview-Commit-ID: 1s9nMzlGT0e
devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js
--- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js
+++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js
@@ -76,17 +76,17 @@ function getCleanedPacket(key, packet) {
 
     if (res.message) {
       // Clean timeStamp on the message prop.
       res.message.timeStamp = existingPacket.message.timeStamp;
       if (res.message.timer) {
         // Clean timer properties on the message.
         // Those properties are found on console.time and console.timeEnd calls,
         // and those time can vary, which is why we need to clean them.
-        if (res.message.timer.duration) {
+        if ("duration" in res.message.timer) {
           res.message.timer.duration = existingPacket.message.timer.duration;
         }
       }
 
       if (Array.isArray(res.message.arguments)) {
         res.message.arguments = res.message.arguments.map((argument, i) => {
           if (!argument || typeof argument !== "object") {
             return argument;