diff options
author | Timo Tijhof <krinklemail@gmail.com> | 2012-10-10 01:48:37 +0200 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-10-09 20:06:31 -0400 |
commit | 7e8b854152beead5ba1c0e9f8683586ee937f72d (patch) | |
tree | 5203ec91ff71aeb0448ba61d04df90ff1b0b326f /test/data | |
parent | bb38f706463a4d7598505b2f7adf3ed83935f298 (diff) | |
download | jquery-7e8b854152beead5ba1c0e9f8683586ee937f72d.tar.gz jquery-7e8b854152beead5ba1c0e9f8683586ee937f72d.zip |
Test: Clean up and fix misc issues
* Clean up testinit and testrunner
* Uncomment isLocal (at least make sure it is declared)
* Rephrase environment assertions to make sense if one reads
them when they pass.
* Optimise an expensive loop that might be the cause of this
in IE6: http://cl.ly/image/3f20053m112n
Diffstat (limited to 'test/data')
-rw-r--r-- | test/data/testinit.js | 9 | ||||
-rw-r--r-- | test/data/testrunner.js | 5 |
2 files changed, 7 insertions, 7 deletions
diff --git a/test/data/testinit.js b/test/data/testinit.js index fbc858665..99b0f11e1 100644 --- a/test/data/testinit.js +++ b/test/data/testinit.js @@ -1,10 +1,13 @@ -/*jshint multistr:true*/ +/*jshint multistr:true */ var jQuery = this.jQuery || "jQuery", // For testing .noConflict() $ = this.$ || "$", originaljQuery = jQuery, original$ = $, hasPHP = true, + // Disable Ajax tests to reduce network strain + // Re-enabled (at least the variable should be declared) + isLocal = window.location.protocol === "file:", amdDefined; /** @@ -123,7 +126,7 @@ if ( document.createEvent ) { * @result "data/test.php?foo=bar&10538358345554" */ function url( value ) { - return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random()*100000); + return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random() * 100000, 10); } (function () { @@ -226,7 +229,7 @@ function url( value ) { jQuery( "<iframe/>" ).attr( "src", url( "./data/" + fileName ) ) ).appendTo( "body" ); }); - } + }; }()); // Sandbox start for great justice diff --git a/test/data/testrunner.js b/test/data/testrunner.js index 70bbc88c3..2a4cbf4e6 100644 --- a/test/data/testrunner.js +++ b/test/data/testrunner.js @@ -123,7 +123,7 @@ function testSubproject( label, url, risTests ) { } fnTest.apply( this, arguments ); - } + }; } } @@ -167,8 +167,5 @@ QUnit.config.testTimeout = 20 * 1000; // 20 seconds return; } - // (Temporarily) Disable Ajax tests to reduce network strain - // isLocal = QUnit.isLocal = true; - document.write("<scr" + "ipt src='http://swarm.jquery.org/js/inject.js?" + (new Date).getTime() + "'></scr" + "ipt>"); })(); |