r100385 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100384‎ | r100385 | r100386 >
Date:22:33, 20 October 2011
Author:krinkle
Status:ok
Tags:
Comment:
[JSTesting] Don't rely on the timeout argument of start/stop. This behavior is removed in the latest QUnit version.
-- Actually, in the latest QUnit version start/stop take 'count' as first argument. It would internally set the number of wait levels to 5000 xD
Modified paths:
  • /trunk/phase3/tests/qunit/data/testrunner.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.test.js (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/qunit/data/testrunner.js
@@ -11,6 +11,11 @@
1212 };
1313
1414 /**
 15+ * Configuration
 16+ */
 17+QUnit.config.testTimeout = 5000;
 18+
 19+/**
1520 * Load TestSwarm agent
1621 */
1722 if ( QUnit.urlParams.swarmURL ) {
Index: trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.test.js
@@ -131,7 +131,7 @@
132132 expect(1);
133133
134134 // Asynchronous ahead
135 - stop(5000);
 135+ stop();
136136
137137 mw.loader.implement( 'is.awesome', [QUnit.fixurl( mw.config.get( 'wgScriptPath' ) + '/tests/qunit/data/defineTestCallback.js' )], {}, {} );
138138
@@ -155,9 +155,9 @@
156156 // Message doesn't exist already
157157 ok( !mw.messages.exists( 'bug29107' ) );
158158
159 - // Async! Include a timeout, as failure in this test leads to neither the
160 - // success nor failure callbacks getting called.
161 - stop(5000);
 159+ // Async! Failure in this test may lead to neither the success nor error callbacks getting called.
 160+ // Due to QUnit's timeout feauture we won't hang here forever if this happends.
 161+ stop();
162162
163163 mw.loader.implement( 'bug29107.messages-only', [], {}, {'bug29107': 'loaded'} );
164164 mw.loader.using( 'bug29107.messages-only', function() {
@@ -180,9 +180,8 @@
181181 base = ('//' + loc.hostname + loc.pathname).replace(/\/[^\/]*$/, ''),
182182 target = base + '/data/qunitOkCall.js?' + (new Date()).getTime();
183183
184 - // Async! Include a timeout, as failure in this test leads to neither the
185 - // success nor failure callbacks getting called.
186 - stop(5000);
 184+ // Async!
 185+ stop();
187186 mw.loader.load( target );
188187 });
189188

Follow-up revisions

RevisionCommit summaryAuthorDate
r100394[JSTesting] MFT r100385, r100387...krinkle23:24, 20 October 2011

Status & tagging log