Bug 1453385 - Fix actors using something else than RetVal in response's spec. r=jryans
MozReview-Commit-ID: 2fRciZoqQSY
--- 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;