[JSTesting] Fix static html tests
authorKrinkle <krinkle@users.mediawiki.org>
Tue, 3 Jan 2012 22:16:24 +0000 (22:16 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Tue, 3 Jan 2012 22:16:24 +0000 (22:16 +0000)
* static tests need wgServer as well
* Follows-up r107946, r107919

tests/qunit/index.html
tests/qunit/suites/resources/mediawiki/mediawiki.test.js

index 9442881..9845cfb 100644 (file)
@@ -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',
index 9214131..13f1985 100644 (file)
@@ -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