diff options
Diffstat (limited to 'addons/web/static/test/framework.js')
| -rw-r--r-- | addons/web/static/test/framework.js | 29 |
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) { }); }); - |
