From 13d58a9bec67356ecae0d6902cb634e52cebcf19 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Fri, 11 Oct 2013 15:08:07 -0400 Subject: [PATCH] No ticket: Fix subproject iframe tests --- test/.jshintrc | 1 + test/data/testinit.js | 15 ++++++++++----- test/data/testrunner.js | 11 +++++++---- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/test/.jshintrc b/test/.jshintrc index b702f6fa5..65c224f0e 100644 --- a/test/.jshintrc +++ b/test/.jshintrc @@ -60,6 +60,7 @@ "originaljQuery": true, "$": true, "original$": true, + "baseURL": true, "externalHost": true } } 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( "
" ).append( - jQuery( "