mw.loader.implement(
'test.implement.b',
function () {
+ // Note: QUnit.start() must only be called when the entire test is
+ // complete. So, make sure that we don't start until *both*
+ // assertStyleAsync calls have completed.
+ var pending = 2;
assertStyleAsync( assert, $element2, 'float', 'left', function () {
assert.notEqual( $element1.css( 'text-align' ), 'center', 'print style is not applied' );
- QUnit.start();
+ pending--;
+ if ( pending === 0 ) {
+ QUnit.start();
+ }
} );
assertStyleAsync( assert, $element3, 'float', 'right', function () {
assert.notEqual( $element1.css( 'text-align' ), 'center', 'print style is not applied' );
- QUnit.start();
+ pending--;
+ if ( pending === 0 ) {
+ QUnit.start();
+ }
} );
},
{