r107949 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107948‎ | r107949 | r107950 >
Date:22:16, 3 January 2012
Author:krinkle
Status:ok
Tags:
Comment:
[JSTesting] Fix static html tests
* static tests need wgServer as well
* Follows-up r107946, r107919
Modified paths:
  • /trunk/phase3/tests/qunit/index.html (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.test.js (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/qunit/index.html
@@ -38,6 +38,7 @@
3939 var scriptPath = pathParts.join( '/' );
4040
4141 mw.config.set({
 42+ "wgServer": location.protocol + '//' + location.host,
4243 "wgScriptPath": scriptPath,
4344 "wgLoadScript": scriptPath + '/load.php',
4445 "stylepath": scriptPath + '/skins',
Index: trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.test.js
@@ -175,19 +175,9 @@
176176
177177 expect(2);
178178
179 - var server = mw.config.get( 'wgServer' ),
180 - basePath = mw.config.get( 'wgScriptPath' );
181 -
182 - // From [[Special:JavaScriptTest]] we need to preprend the script path
183 - // with the actual server (http://localhost/).
184 - // Running from file tests/qunit/index.html, wgScriptPath is already
185 - // including the wgServer part
186 - if( server !== null ) {
187 - basePath = server + basePath;
188 - }
189179 // Forge an URL to the test callback script
190180 var target = QUnit.fixurl(
191 - basePath + '/tests/qunit/data/qunitOkCall.js'
 181+ mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/tests/qunit/data/qunitOkCall.js'
192182 );
193183
194184 // Confirm that mw.loader.load() works with protocol-relative URLs

Sign-offs

UserFlagDate
Nikerabbitinspected09:53, 4 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r107919merge JSTesting branch into trunk...hashar18:33, 3 January 2012
r107946[JSTesting] Fix static html tests...krinkle21:53, 3 January 2012

Status & tagging log