r89243 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89242‎ | r89243 | r89244 >
Date:00:13, 1 June 2011
Author:brion
Status:ok (Comments)
Tags:
Comment:
Follow-up to r88706: add qunit regression test case for bug 29107.

Confirms that messages-only modules trigger a ready callback.
Modified paths:
  • /trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.js (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.js
@@ -173,6 +173,18 @@
174174
175175 });
176176
 177+test( 'mw.loader.bug29107' , function() {
 178+ expect( 1 );
 179+
 180+ mw.loader.implement( 'bug29107.messages-only', [], {}, {'bug29107': 'loaded'} );
 181+ mw.loader.using( 'bug29107.messages-only', function() {
 182+ ok( mw.messages.exists( 'bug29107' ), 'Bug 29107: messages-only module should load ok' );
 183+ }, function(){
 184+ start();
 185+ deepEqual( true, false, 'Implementing a module, error callback fired!' );
 186+ });
 187+});
 188+
177189 test( 'mw.html', function(){
178190
179191 equal( mw.html.escape( '<mw awesome="awesome" value=\'test\' />' ),

Follow-up revisions

RevisionCommit summaryAuthorDate
r89247Follow-up to r89243 to fix the async qunit test...brion01:24, 1 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88706* (bug 29107) Fix regression in ResourceLoader debug mode for WikiEditor...brion00:42, 24 May 2011

Comments

#Comment by Krinkle (talk | contribs)   00:28, 1 June 2011

there's start() but no stop() on top or start() in the success-callback.

Per IRC discussion, async sucks in combination with expect() if there's a chance the error callback wont get called either.

But without the async stop/start the test result could end up in another block and the QUnit would nag "Expected 1 assertions, but 0 were run".

Hm... just looking at the QUnit source, a possible work-around would be to use the timeout feature of stop()

#Comment by Brion VIBBER (talk | contribs)   01:29, 1 June 2011

The timeout works correctly with this failure case, yay! It possibly should be added to other users of stop() as well, in case those fail too.

Committed (for this case only) in r89247

Status & tagging log