summaryrefslogtreecommitdiff
path: root/addons/web/static/test/framework.js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2016-06-16 14:00:22 +0200
committerGéry Debongnie <ged@odoo.com>2016-06-17 13:24:54 +0200
commitcfe4b337af7c5ccef586289d1bd7d69a700d5d93 (patch)
treedca60967bb75e35960292c2141feb048ff8f369e /addons/web/static/test/framework.js
parentcfe13f79e6ab513f9753ee995cf9bd56dab4d3a4 (diff)
[REF] web: move async_when to utils
Diffstat (limited to 'addons/web/static/test/framework.js')
-rw-r--r--addons/web/static/test/framework.js29
1 files changed, 14 insertions, 15 deletions
diff --git a/addons/web/static/test/framework.js b/addons/web/static/test/framework.js
index 70cc016fbcc..f3add74d7c5 100644
--- a/addons/web/static/test/framework.js
+++ b/addons/web/static/test/framework.js
@@ -433,30 +433,30 @@ odoo.define_section('Widget.events', ['web.Widget', 'web.core'], function (test)
});
});
-odoo.define_section('Widget.async', ['web.Widget'], function (test) {
- test("alive(alive)", function (assert, Widget) {
+odoo.define_section('Widget.async', ['web.Widget', 'web.utils'], function (test) {
+ test("alive(alive)", function (assert, Widget, utils) {
assert.expect(1);
var widget = new (Widget.extend({}));
- return $.async_when(widget.start())
- .then(function () { return widget.alive($.async_when()) })
+ return utils.async_when(widget.start())
+ .then(function () { return widget.alive(utils.async_when()) })
.then(function () { assert.ok(true); });
});
- test("alive(dead)", function (assert, Widget) {
+ test("alive(dead)", function (assert, Widget, utils) {
assert.expect(1);
var widget = new (Widget.extend({}));
return $.Deferred(function (d) {
- $.async_when(widget.start())
+ utils.async_when(widget.start())
.then(function () {
// destroy widget
widget.destroy();
- var promise = $.async_when();
+ var promise = utils.async_when();
// leave time for alive() to do its stuff
promise.then(function () {
- return $.async_when();
+ return utils.async_when();
}).then(function () {
assert.ok(true);
d.resolve();
@@ -470,26 +470,26 @@ odoo.define_section('Widget.async', ['web.Widget'], function (test) {
});
});
- test("alive(alive, true)", function (assert, Widget) {
+ test("alive(alive, true)", function (assert, Widget, utils) {
assert.expect(1);
var widget = new (Widget.extend({}));
- return $.async_when(widget.start())
- .then(function () { return widget.alive($.async_when(), true) })
+ return utils.async_when(widget.start())
+ .then(function () { return widget.alive(utils.async_when(), true) })
.then(function () { assert.ok(true); });
});
- test("alive(dead, true)", function (assert, Widget) {
+ test("alive(dead, true)", function (assert, Widget, utils) {
assert.expect(1);
var done = assert.async();
var widget = new (Widget.extend({}));
- $.async_when(widget.start())
+ utils.async_when(widget.start())
.then(function () {
// destroy widget
widget.destroy();
console.log('destroyed');
- return widget.alive($.async_when().done(function () { console.log('when'); }), true);
+ return widget.alive(utils.async_when().done(function () { console.log('when'); }), true);
}).then(function () {
console.log('unfailed')
assert.ok(false, "alive(p, true) should fail its promise");
@@ -630,4 +630,3 @@ odoo.define_section('server-formats', ['web.time'], function (test) {
});
});
-