r88705 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88704‎ | r88705 | r88706 >
Date:00:21, 24 May 2011
Author:krinkle
Status:ok
Tags:
Comment:
Rewriting mw.loader test suite. The previous one didn't work properly in IE6-IE8.
Modified paths:
  • /trunk/phase3/tests/qunit/sample/awesome.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.js (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/qunit/sample/awesome.js
@@ -1 +1,4 @@
2 -window.awesome = true;
 2+window.mw.loader.testCallback = function(){
 3+ start();
 4+ deepEqual( true, true, 'Implementing a module, is the callback timed properly ?');
 5+};
Index: trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.js
@@ -90,20 +90,22 @@
9191 "Extracting path from local URL (file://) with fragment"
9292 );
9393
 94+ // Asynchronous ahead
9495 stop();
9596
96 - var tests_path = rePath.exec( location.href ); // Extract path
 97+ // Extract path
 98+ var tests_path = rePath.exec( location.href );
 99+
97100 mw.loader.implement( 'is.awesome', [tests_path + 'sample/awesome.js'], {}, {} );
 101+
98102 mw.loader.using( 'is.awesome', function(){
99 - start();
100 - deepEqual( window.awesome, true, 'Implementing a module, is the callback timed properly ?');
101103
102 - // Clean up
103 - delete window.awesome;
 104+ // awesome.js declares this function
 105+ mw.loader.testCallback();
104106
105107 }, function(){
106108 start();
107 - deepEqual( 'mw.loader.using error callback fired', true, 'Implementing a module, is the callback timed properly ?');
 109+ deepEqual( true, false, 'Implementing a module, error callback fired!');
108110 });
109111
110112 });

Status & tagging log