Bug 1453385 - Fix actors using something else than RetVal in response's spec. r=jryans
authorAlexandre Poirot <poirot.alex@gmail.com>
Fri, 13 Apr 2018 02:56:46 -0700
changeset 413264 a7561379843f63c1a548ff1842ba5e7359580d43
parent 413263 49862a0820f94e96d07d3e20174b01f24871bf6e
child 413316 8d5ceb354e86622e56578fc126d23949e53591b5
push id62660
push userapoirot@mozilla.com
push dateFri, 13 Apr 2018 21:26:39 +0000
treeherderautoland@a7561379843f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1453385
milestone61.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 1453385 - Fix actors using something else than RetVal in response's spec. r=jryans MozReview-Commit-ID: 2fRciZoqQSY
devtools/server/performance/memory.js
devtools/server/tests/unit/test_protocol_children.js
devtools/shared/specs/memory.js
devtools/shared/specs/performance.js
--- a/devtools/server/performance/memory.js
+++ b/devtools/server/performance/memory.js
@@ -71,26 +71,28 @@ Memory.prototype = {
    * This attaches the MemoryBridge's Debugger instance so that you can start
    * recording allocations or take a census of the heap. In addition, the
    * MemoryBridge will start emitting GC events.
    */
   attach: expectState("detached", function() {
     this.dbg.addDebuggees();
     this.dbg.memory.onGarbageCollection = this._onGarbageCollection.bind(this);
     this.state = "attached";
+    return this.state;
   }, "attaching to the debugger"),
 
   /**
    * Detach from this MemoryBridge.
    */
   detach: expectState("attached", function() {
     this._clearDebuggees();
     this.dbg.enabled = false;
     this._dbg = null;
     this.state = "detached";
+    return this.state;
   }, "detaching from the debugger"),
 
   /**
    * Gets the current MemoryBridge attach/detach state.
    */
   getState: function() {
     return this.state;
   },
--- a/devtools/server/tests/unit/test_protocol_children.js
+++ b/devtools/server/tests/unit/test_protocol_children.js
@@ -76,17 +76,17 @@ const childSpec = protocol.generateActor
       request: { inputArray: Arg(0, "array:number") },
       response: RetVal("array:number")
     },
     getSibling: {
       request: { id: Arg(0) },
       response: { sibling: RetVal("childActor") }
     },
     emitEvents: {
-      response: { value: "correct response" },
+      response: { value: RetVal("string") },
     },
     release: {
       release: true
     }
   }
 });
 
 var ChildActor = protocol.ActorClassWithSpec(childSpec, {
@@ -151,16 +151,17 @@ var ChildActor = protocol.ActorClassWith
   },
 
   emitEvents: function() {
     EventEmitter.emit(this, "event1", 1, 2, 3);
     EventEmitter.emit(this, "event2", 4, 5, 6);
     EventEmitter.emit(this, "named-event", 1, 2, 3);
     EventEmitter.emit(this, "object-event", this);
     EventEmitter.emit(this, "array-object-event", [this]);
+    return "correct response";
   },
 
   release: function() { },
 });
 
 var ChildFront = protocol.FrontClassWithSpec(childSpec, {
   initialize: function(client, form) {
     protocol.Front.prototype.initialize.call(this, client, form);
--- a/devtools/shared/specs/memory.js
+++ b/devtools/shared/specs/memory.js
@@ -45,23 +45,23 @@ const memorySpec = generateActorSpec({
       data: Arg(0, "json"),
     },
   },
 
   methods: {
     attach: {
       request: {},
       response: {
-        type: "attached"
+        type: RetVal("string")
       }
     },
     detach: {
       request: {},
       response: {
-        type: "detached"
+        type: RetVal("string")
       }
     },
     getState: {
       response: {
         state: RetVal(0, "string")
       }
     },
     takeCensus: {
--- a/devtools/shared/specs/performance.js
+++ b/devtools/shared/specs/performance.js
@@ -74,14 +74,14 @@ const performanceSpec = generateActorSpe
 
     getConfiguration: {
       request: {},
       response: { config: RetVal("json") }
     },
 
     setProfilerStatusInterval: {
       request: { interval: Arg(0, "number") },
-      response: { oneway: true }
+      oneway: true
     },
   }
 });
 
 exports.performanceSpec = performanceSpec;