mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-24 08:13:38 +00:00
Fix mmv.model.TaskQueue qunit tests
Bug: T164473 Change-Id: Iaefae1d00a0469f11ddb3fcecb4f831346ac0eec
This commit is contained in:
parent
4c3302d957
commit
19fdcc86f3
|
@ -36,14 +36,15 @@
|
|||
|
||||
QUnit.test( 'State check', 3, function ( assert ) {
|
||||
var taskQueue = new mw.mmv.model.TaskQueue(),
|
||||
task = $.Deferred();
|
||||
task = $.Deferred(),
|
||||
promise;
|
||||
|
||||
taskQueue.push( function () { return task; } );
|
||||
|
||||
assert.strictEqual( taskQueue.state, mw.mmv.model.TaskQueue.State.NOT_STARTED,
|
||||
'state is initially NOT_STARTED' );
|
||||
|
||||
taskQueue.execute().then( function () {
|
||||
promise = taskQueue.execute().then( function () {
|
||||
assert.strictEqual( taskQueue.state, mw.mmv.model.TaskQueue.State.FINISHED,
|
||||
'state is FINISHED after execution finished' );
|
||||
} );
|
||||
|
@ -51,7 +52,9 @@
|
|||
assert.strictEqual( taskQueue.state, mw.mmv.model.TaskQueue.State.RUNNING,
|
||||
'state is RUNNING after execution started' );
|
||||
|
||||
return task.resolve();
|
||||
task.resolve();
|
||||
|
||||
return promise;
|
||||
} );
|
||||
|
||||
QUnit.test( 'State check for cancellation', 1, function ( assert ) {
|
||||
|
|
Loading…
Reference in a new issue