Tests: Refactor testIframe() to make it DRYer and more consistent

Ref gh-3040
Closes gh-3049
This commit is contained in:
Dave Methvin
2016-04-10 15:42:44 -04:00
parent 08d73d7f9c
commit e5ffcb0838
42 changed files with 142 additions and 110 deletions

View File

@@ -232,15 +232,15 @@ this.ajaxTest = function( title, expect, options ) {
} );
};
this.testIframeWithCallback = function( title, fileName, func ) {
QUnit.test( title, 1, function( assert ) {
this.testIframe = function( title, fileName, func ) {
QUnit.test( title, function( assert ) {
var iframe;
var done = assert.async();
window.iframeCallback = function() {
var args = Array.prototype.slice.call( arguments );
args.push( assert );
args.unshift( assert );
setTimeout( function() {
this.iframeCallback = undefined;
@@ -248,7 +248,6 @@ this.testIframeWithCallback = function( title, fileName, func ) {
func.apply( this, args );
func = function() {};
iframe.remove();
done();
} );
};