Commit 689c76ae authored by Romain Courteaud's avatar Romain Courteaud

Ensure iframe methods return RSVP.Queue.

parent f510b4c6
...@@ -505,8 +505,8 @@ ...@@ -505,8 +505,8 @@
gadget_instance.__chan.bind("declareMethod", gadget_instance.__chan.bind("declareMethod",
function (trans, method_name) { function (trans, method_name) {
gadget_instance[method_name] = function () { gadget_instance[method_name] = function () {
var argument_list = arguments; var argument_list = arguments,
return new RSVP.Promise(function (resolve, reject) { wait_promise = new RSVP.Promise(function (resolve, reject) {
gadget_instance.__chan.call({ gadget_instance.__chan.call({
method: "methodCall", method: "methodCall",
params: [ params: [
...@@ -520,6 +520,10 @@ ...@@ -520,6 +520,10 @@
} }
}); });
}); });
return new RSVP.Queue()
.push(function () {
return wait_promise;
});
}; };
return "OK"; return "OK";
}); });
......
...@@ -3248,6 +3248,15 @@ ...@@ -3248,6 +3248,15 @@
.then(function (new_gadget) { .then(function (new_gadget) {
return new RSVP.Queue() return new RSVP.Queue()
// Method returns an RSVP.Queue
.push(function () {
var result = new_gadget.wasReadyCalled();
ok(
result instanceof RSVP.Queue,
"iframe method should return Queue"
);
})
// Check that ready function are called // Check that ready function are called
.push(function () { .push(function () {
return new_gadget.wasReadyCalled(); return new_gadget.wasReadyCalled();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment