diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2013-10-11 15:08:07 -0400 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2013-10-11 15:08:07 -0400 |
commit | 13d58a9bec67356ecae0d6902cb634e52cebcf19 (patch) | |
tree | 76159c24b88462f73bf1790c9be3256c85eb77ba /test/data/testinit.js | |
parent | c93743b4faf7db5e2b95eee287adaece975541e3 (diff) | |
download | jquery-13d58a9bec67356ecae0d6902cb634e52cebcf19.tar.gz jquery-13d58a9bec67356ecae0d6902cb634e52cebcf19.zip |
No ticket: Fix subproject iframe tests
Diffstat (limited to 'test/data/testinit.js')
-rw-r--r-- | test/data/testinit.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/data/testinit.js b/test/data/testinit.js index c35383c6b..d4b2abc16 100644 --- a/test/data/testinit.js +++ b/test/data/testinit.js @@ -1,6 +1,7 @@ /*jshint multistr:true, quotmark:false */ var fireNative, originaljQuery, original$, + baseURL = "", supportjQuery = this.jQuery, // see RFC 2606 externalHost = "example.com"; @@ -130,7 +131,8 @@ fireNative = document.createEvent ? * @result "data/test.php?foo=bar&10538358345554" */ function url( value ) { - return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random() * 100000, 10); + return baseURL + value + (/\?/.test(value) ? "&" : "?") + + new Date().getTime() + "" + parseInt(Math.random() * 100000, 10); } // Ajax testing helper @@ -236,6 +238,9 @@ this.testIframeWithCallback = function( title, fileName, func ) { test( title, function() { var iframe; + // Expect one assertion, but allow overrides + expect( 1 ); + stop(); window.iframeCallback = function() { var self = this, @@ -248,12 +253,12 @@ this.testIframeWithCallback = function( title, fileName, func ) { start(); }, 0 ); }; - iframe = jQuery( "<div/>" ).append( - jQuery( "<iframe/>" ).attr( "src", url( "./data/" + fileName ) ) - ).appendTo( "body" ); + iframe = jQuery( "<div/>" ).css({ position: "absolute", width: "500px", left: "-600px" }) + .append( jQuery( "<iframe/>" ).attr( "src", url( "./data/" + fileName ) ) ) + .appendTo( "#qunit-fixture" ); }); }; -this.iframeCallback = undefined; +window.iframeCallback = undefined; // Tests are always loaded async QUnit.config.autostart = false; |