Bug 900776 - Trace actor reports NaN time when exiting frames; r=fitzgen
authorJake Bailey <rjbailey@mozilla.com>
Fri, 02 Aug 2013 17:26:30 -0700
changeset 153503 24446c5f75c1c42fab6cc1840c7651e0d33fcb40
parent 153502 f87e93861239dace12e3182453136fa0a71fb9e4
child 153504 f98860de7350c11ce4b3f211e25dfab6f53f99e2
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfitzgen
bugs900776
milestone25.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 900776 - Trace actor reports NaN time when exiting frames; r=fitzgen
toolkit/devtools/server/actors/tracer.js
toolkit/devtools/server/tests/unit/test_trace_actor-04.js
toolkit/devtools/server/tests/unit/test_trace_actor-05.js
--- a/toolkit/devtools/server/actors/tracer.js
+++ b/toolkit/devtools/server/actors/tracer.js
@@ -281,17 +281,20 @@ TraceActor.prototype = {
    */
   onExitFrame: function(aValue) {
     let packet = {
       from: this.actorID,
       type: "exitedFrame",
       sequence: this._sequence++
     };
 
-    this._handleEvent(TraceTypes.Events.exitFrame, packet, { value: aValue });
+    this._handleEvent(TraceTypes.Events.exitFrame, packet, {
+      value: aValue,
+      startTime: this._startTime
+    });
 
     this.conn.send(packet);
   }
 };
 
 /**
  * The request types this actor can handle.
  */
--- a/toolkit/devtools/server/tests/unit/test_trace_actor-04.js
+++ b/toolkit/devtools/server/tests/unit/test_trace_actor-04.js
@@ -35,27 +35,31 @@ function test_enter_exit_frame()
   let packetNames = [];
 
   gTraceClient.addListener("enteredFrame", function(aEvent, aPacket) {
     packetsSeen++;
     do_check_eq(aPacket.type, "enteredFrame",
                 'enteredFrame response should have type "enteredFrame"');
     do_check_eq(typeof aPacket.sequence, "number",
                 'enteredFrame response should have sequence number');
+    do_check_true(!isNaN(aPacket.sequence),
+                  'enteredFrame sequence should be a number');
     do_check_eq(typeof aPacket.name, "string",
                 'enteredFrame response should have function name');
     packetNames[aPacket.sequence] = aPacket.name;
   });
 
   gTraceClient.addListener("exitedFrame", function(aEvent, aPacket) {
     packetsSeen++;
     do_check_eq(aPacket.type, "exitedFrame",
                 'exitedFrame response should have type "exitedFrame"');
     do_check_eq(typeof aPacket.sequence, "number",
                 'exitedFrame response should have sequence number');
+    do_check_true(!isNaN(aPacket.sequence),
+                  'exitedFrame sequence should be a number');
   });
 
   start_trace()
     .then(eval_code)
     .then(stop_trace)
     .then(function() {
       do_check_eq(packetsSeen, 10,
                   'Should have seen two packets for each of 5 stack frames');
--- a/toolkit/devtools/server/tests/unit/test_trace_actor-05.js
+++ b/toolkit/devtools/server/tests/unit/test_trace_actor-05.js
@@ -32,32 +32,40 @@ function test_enter_exit_frame()
 {
   let packets = [];
 
   gTraceClient.addListener("enteredFrame", function(aEvent, aPacket) {
     do_check_eq(aPacket.type, "enteredFrame",
                 'enteredFrame response should have type "enteredFrame"');
     do_check_eq(typeof aPacket.sequence, "number",
                 'enteredFrame response should have sequence number');
+    do_check_true(!isNaN(aPacket.sequence),
+                  'enteredFrame sequence should be a number');
     do_check_eq(typeof aPacket.name, "string",
                 'enteredFrame response should have function name');
     do_check_eq(typeof aPacket.callsite, "object",
                 'enteredFrame response should have callsite');
     do_check_eq(typeof aPacket.time, "number",
                 'enteredFrame response should have time');
+    do_check_true(!isNaN(aPacket.time),
+                  'enteredFrame time should be a number');
     packets[aPacket.sequence] = aPacket;
   });
 
   gTraceClient.addListener("exitedFrame", function(aEvent, aPacket) {
     do_check_eq(aPacket.type, "exitedFrame",
                 'exitedFrame response should have type "exitedFrame"');
     do_check_eq(typeof aPacket.sequence, "number",
                 'exitedFrame response should have sequence number');
+    do_check_true(!isNaN(aPacket.sequence),
+                  'exitedFrame sequence should be a number');
     do_check_eq(typeof aPacket.time, "number",
                 'exitedFrame response should have time');
+    do_check_true(!isNaN(aPacket.time),
+                  'exitedFrame time should be a number');
     packets[aPacket.sequence] = aPacket;
   });
 
   start_trace()
     .then(eval_code)
     .then(stop_trace)
     .then(function() {
       do_check_eq(packets[2].name, "foo",