diff options
author | Jose <jose@zeroc.com> | 2015-09-21 21:39:49 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2015-09-21 21:39:49 +0200 |
commit | db7c44b3867086e4ffaa0251a2dd5f9fe9368807 (patch) | |
tree | 67e30375a920c042ab4bb839a3f397aa086f1ab4 /js/test | |
parent | ICE-6634 - Using Ice in background worker. (diff) | |
download | ice-db7c44b3867086e4ffaa0251a2dd5f9fe9368807.tar.bz2 ice-db7c44b3867086e4ffaa0251a2dd5f9fe9368807.tar.xz ice-db7c44b3867086e4ffaa0251a2dd5f9fe9368807.zip |
JS issue with Promise.delay
When using Firefox and runing Ice from a web worker
Promise.delay was not working as expected, sometimes
the callback was fired without delay.
Diffstat (limited to 'js/test')
-rw-r--r-- | js/test/Ice/promise/Client.js | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/js/test/Ice/promise/Client.js b/js/test/Ice/promise/Client.js index 7a6b4a2efb5..7e3beff8370 100644 --- a/js/test/Ice/promise/Client.js +++ b/js/test/Ice/promise/Client.js @@ -833,16 +833,7 @@ test(i == 10); test(Date.now() - start >= 450 && Date.now() - start <= 650); } - ).exception( - function(ex) - { - promise.fail(ex); - }); - - // - // Now test the static version. - // - p = p.then( + ).then( function() { start = Date.now(); @@ -852,17 +843,9 @@ test(i == 10); test(Date.now() - start >= 450 && Date.now() - start <= 650); } - ).exception( - function(ex) - { - promise.fail(ex); - }); - }); - - // - // Same but with fail - // - p.then( + ) + } + ).then( function() { var f = new Promise(); @@ -879,11 +862,12 @@ out.writeLine("ok"); promise.succeed(); } - ).exception( - function(ex) - { - promise.fail(ex); - }); + ) + } + ).exception( + function(ex) + { + promise.fail(ex); }); } ); |