From 66dd95ee17dfd3ccb68a8c59fd621ab2cbf84a32 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Thu, 12 May 2016 22:03:30 -0400 Subject: [PATCH] Tests: Refactor iframe tests to be more like core This makes the arg order and basic approach closer to what is now being used in core. It also removes some of the boilerplate from the iframe html pages and moves it to a new iframeTest.js file that they all include. --- test/core.js | 4 ++-- test/event-props.html | 8 ++------ test/event.js | 25 ++++++++++++------------- test/iframeTest.js | 29 +++++++++++++++++++++++++++++ test/old-jquery.html | 17 ++--------------- test/ready-event.html | 8 +++----- test/testinit.js | 2 +- 7 files changed, 51 insertions(+), 42 deletions(-) create mode 100644 test/iframeTest.js diff --git a/test/core.js b/test/core.js index 19f66a3d..673e1dcb 100644 --- a/test/core.js +++ b/test/core.js @@ -273,8 +273,8 @@ test( "jQuery.expr.pseudos aliases", function( assert ) { } ); TestManager.runIframeTest( "old pre-3.0 jQuery", "old-jquery.html", - function( logOutput, assert ) { + function( assert, jQuery, window, document, log ) { assert.expect( 1 ); - assert.ok( /jQuery 3/.test( logOutput ), "logged: " + logOutput ); + assert.ok( /jQuery 3/.test( log ), "logged: " + log ); } ); diff --git a/test/event-props.html b/test/event-props.html index 5d08cc70..29a68910 100644 --- a/test/event-props.html +++ b/test/event-props.html @@ -8,17 +8,13 @@ + + diff --git a/test/ready-event.html b/test/ready-event.html index f2512b22..78751fa1 100644 --- a/test/ready-event.html +++ b/test/ready-event.html @@ -8,18 +8,16 @@ + diff --git a/test/testinit.js b/test/testinit.js index 23e978e6..3f848b28 100644 --- a/test/testinit.js +++ b/test/testinit.js @@ -78,7 +78,7 @@ TestManager = { self.iframeCallback = function() { var args = Array.prototype.slice.call( arguments ); - args.push( assert ); + args.unshift( assert ); setTimeout( function() { self.iframeCallback = undefined;