From: Krinkle Date: Tue, 3 Jan 2012 22:16:24 +0000 (+0000) Subject: [JSTesting] Fix static html tests X-Git-Tag: 1.31.0-rc.0~25575 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=4d7c89ebd8c6e4ab4c7b1ffe869998acd4c2a984;p=lhc%2Fweb%2Fwiklou.git [JSTesting] Fix static html tests * static tests need wgServer as well * Follows-up r107946, r107919 --- diff --git a/tests/qunit/index.html b/tests/qunit/index.html index 94428812e7..9845cfbba1 100644 --- a/tests/qunit/index.html +++ b/tests/qunit/index.html @@ -38,6 +38,7 @@ var scriptPath = pathParts.join( '/' ); mw.config.set({ + "wgServer": location.protocol + '//' + location.host, "wgScriptPath": scriptPath, "wgLoadScript": scriptPath + '/load.php', "stylepath": scriptPath + '/skins', diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.test.js index 92141315df..13f19852b6 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.test.js @@ -175,19 +175,9 @@ test( 'mw.loader.bug30825', function() { expect(2); - var server = mw.config.get( 'wgServer' ), - basePath = mw.config.get( 'wgScriptPath' ); - - // From [[Special:JavaScriptTest]] we need to preprend the script path - // with the actual server (http://localhost/). - // Running from file tests/qunit/index.html, wgScriptPath is already - // including the wgServer part - if( server !== null ) { - basePath = server + basePath; - } // Forge an URL to the test callback script var target = QUnit.fixurl( - basePath + '/tests/qunit/data/qunitOkCall.js' + mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/tests/qunit/data/qunitOkCall.js' ); // Confirm that mw.loader.load() works with protocol-relative URLs