From 8effe3a7dee91c833cc1774646da9d743600c64c Mon Sep 17 00:00:00 2001 From: jeresig Date: Tue, 23 Mar 2010 12:12:16 -0400 Subject: Made it so that you no longer need to build jQuery in order to run the test suite (but you'll still need a checkout of QUnit and Sizzle, at least). --- test/index.html | 50 ++++++++++++++++++++++++++++++++----------------- test/unit/attributes.js | 12 ++++++++---- 2 files changed, 41 insertions(+), 21 deletions(-) (limited to 'test') diff --git a/test/index.html b/test/index.html index d6d02f47f..13abd97f9 100644 --- a/test/index.html +++ b/test/index.html @@ -6,23 +6,39 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/unit/attributes.js b/test/unit/attributes.js index d7abbad35..21d3d94bc 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -482,8 +482,10 @@ test("addClass(Function) with incoming value", function() { }); div.addClass(function(i, val) { - equals( val, old[i], "Make sure the incoming value is correct." ); - return "test"; + if ( this.id !== "_firebugConsole" ) { + equals( val, old[i], "Make sure the incoming value is correct." ); + return "test"; + } }); var pass = true; @@ -553,8 +555,10 @@ test("removeClass(Function) with incoming value", function() { }); $divs.removeClass(function(i, val) { - equals( val, old[i], "Make sure the incoming value is correct." ); - return "test"; + if ( this.id !== "_firebugConsole" ) { + equals( val, old[i], "Make sure the incoming value is correct." ); + return "test"; + } }); ok( !$divs.is('.test'), "Remove Class" ); -- cgit v1.2.3 From f6a50cacd8cd7663650d3ff5557cc20bfcdcd765 Mon Sep 17 00:00:00 2001 From: jeresig Date: Tue, 23 Mar 2010 12:19:47 -0400 Subject: Handle auto-running of the TestSwarm injection script in the test suite. --- test/data/testrunner.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/data/testrunner.js b/test/data/testrunner.js index 95a1b6eec..a45934075 100644 --- a/test/data/testrunner.js +++ b/test/data/testrunner.js @@ -1 +1,11 @@ jQuery.noConflict(); // Allow the test to run with other libs or jQuery's. + +// load testswarm agent +(function() { + var url = window.location.search; + url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) ); + if ( !url || url.indexOf("http") !== 0 ) { + return; + } + document.write(""); +})(); -- cgit v1.2.3 From fa80693c4a2302993c4b18ac49d30c26f16d517d Mon Sep 17 00:00:00 2001 From: jeresig Date: Tue, 23 Mar 2010 12:31:40 -0400 Subject: Changed the order of the tests to run in the same order in which they're specified in the Makefile (fixed a dimensions test bug that popped up as a result). --- test/index.html | 19 ++++++++++--------- test/unit/dimensions.js | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'test') diff --git a/test/index.html b/test/index.html index 13abd97f9..be1f3632a 100644 --- a/test/index.html +++ b/test/index.html @@ -10,35 +10,36 @@ - - - + + + - - + + + - + + - - - + + diff --git a/test/unit/dimensions.js b/test/unit/dimensions.js index 74405cee7..539779077 100644 --- a/test/unit/dimensions.js +++ b/test/unit/dimensions.js @@ -26,7 +26,7 @@ function testWidth( val ) { $div.css({ display: "", border: "", padding: "" }); - jQuery("#nothiddendivchild").css({ padding: "3px", border: "2px solid #fff" }); + jQuery("#nothiddendivchild").css({ width: 20, padding: "3px", border: "2px solid #fff" }); equals(jQuery("#nothiddendivchild").width(), 20, "Test child width with border and padding"); jQuery("#nothiddendiv, #nothiddendivchild").css({ border: "", padding: "", width: "" }); -- cgit v1.2.3 From 2301e2a1c3418b4588653e26f9171577e0077aec Mon Sep 17 00:00:00 2001 From: jeresig Date: Tue, 23 Mar 2010 15:21:42 -0400 Subject: Update the TestSwarm URL to point to the new jQuery swarm location. --- test/data/testrunner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/data/testrunner.js b/test/data/testrunner.js index a45934075..a0eb3621a 100644 --- a/test/data/testrunner.js +++ b/test/data/testrunner.js @@ -7,5 +7,5 @@ jQuery.noConflict(); // Allow the test to run with other libs or jQuery's. if ( !url || url.indexOf("http") !== 0 ) { return; } - document.write(""); + document.write(""); })(); -- cgit v1.2.3 From 0fbac16dbe77b6bf846b43d3ef3bd75c374e2628 Mon Sep 17 00:00:00 2001 From: jeresig Date: Tue, 23 Mar 2010 16:22:09 -0400 Subject: Strip off filename and query string for JSONP Remote test. --- test/unit/ajax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/unit/ajax.js b/test/unit/ajax.js index ce257f88a..135e0541a 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -774,7 +774,7 @@ test("jQuery.ajax() - JSONP, Remote", function() { var count = 0; function plus(){ if ( ++count == 4 ) start(); } - var base = window.location.href.replace(/\?.*$/, ""); + var base = window.location.href.replace(/[^\/]*$/, ""); stop(); -- cgit v1.2.3 From 273822c138c70b1d58e2d1199090e9efa3e0e53e Mon Sep 17 00:00:00 2001 From: jeresig Date: Tue, 23 Mar 2010 16:24:51 -0400 Subject: Update other remote test URLs as well. --- test/unit/ajax.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 135e0541a..be4b3f021 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -836,7 +836,7 @@ test("jQuery.ajax() - JSONP, Remote", function() { test("jQuery.ajax() - script, Remote", function() { expect(2); - var base = window.location.href.replace(/\?.*$/, ""); + var base = window.location.href.replace(/[^\/]*$/, ""); stop(); @@ -853,7 +853,7 @@ test("jQuery.ajax() - script, Remote", function() { test("jQuery.ajax() - script, Remote with POST", function() { expect(3); - var base = window.location.href.replace(/\?.*$/, ""); + var base = window.location.href.replace(/[^\/]*$/, ""); stop(); @@ -876,7 +876,7 @@ test("jQuery.ajax() - script, Remote with POST", function() { test("jQuery.ajax() - script, Remote with scheme-less URL", function() { expect(2); - var base = window.location.href.replace(/\?.*$/, ""); + var base = window.location.href.replace(/[^\/]*$/, ""); base = base.replace(/^.*?\/\//, "//"); stop(); @@ -991,7 +991,7 @@ test("jQuery.getJSON - Using Native JSON", function() { test("jQuery.getJSON(String, Function) - JSON object with absolute url to local content", function() { expect(2); - var base = window.location.href.replace(/\?.*$/, ""); + var base = window.location.href.replace(/[^\/]*$/, ""); stop(); jQuery.getJSON(url(base + "data/json.php"), function(json) { -- cgit v1.2.3 From 96ea3d615ef1511bc9ebe45cd34dda2d5af87559 Mon Sep 17 00:00:00 2001 From: jeresig Date: Tue, 23 Mar 2010 16:37:40 -0400 Subject: Make sure the offset tests work without a built jQuery file. --- test/data/offset/absolute.html | 11 ++++++++++- test/data/offset/body.html | 10 +++++++++- test/data/offset/fixed.html | 10 +++++++++- test/data/offset/relative.html | 10 +++++++++- test/data/offset/scroll.html | 10 +++++++++- test/data/offset/static.html | 10 +++++++++- test/data/offset/table.html | 10 +++++++++- 7 files changed, 64 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/data/offset/absolute.html b/test/data/offset/absolute.html index 3bbc8417d..bbd4681b1 100644 --- a/test/data/offset/absolute.html +++ b/test/data/offset/absolute.html @@ -14,6 +14,15 @@ #marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; } p.instructions { position: absolute; bottom: 0; } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +