From 2ef4093cf7f52383dd43bd361864edcda27e5c3c Mon Sep 17 00:00:00 2001 From: John Resig Date: Sun, 19 Aug 2007 23:37:26 +0000 Subject: Complete overhaul of the Ajax test suite, it's now passing in all browsers. In order to achieve this I had to fix a numbe r of bugs in the suite itself, along with other random bugs that popped up. The following bugs were resolved along the wa y: #1236 (.extend() keeps processing when it hits nulls), #1028 (.extend() now works recursively), #1080 ($.get no longer overwrites the data parameter), #1210 (Creating script and link tags now work), and #1463 (jQuery.global has been re-too led to no longer leak memory and slow things down). --- build/runtest/test.js | 6 +++--- build/test/data/dashboard.xml | 20 ++++++++++---------- build/test/data/test.html | 7 +++++++ build/test/data/test.js | 4 ++-- build/test/data/test2.html | 5 +++++ build/test/data/test2.php | 3 --- build/test/data/testrunner.js | 18 ++++++++++++------ build/test/index.html | 2 +- 8 files changed, 40 insertions(+), 25 deletions(-) create mode 100644 build/test/data/test.html create mode 100644 build/test/data/test2.html delete mode 100644 build/test/data/test2.php (limited to 'build') diff --git a/build/runtest/test.js b/build/runtest/test.js index 00b85e419..5599b8d16 100644 --- a/build/runtest/test.js +++ b/build/runtest/test.js @@ -11,11 +11,11 @@ window.onload = function(){ load( "src/jquery/coreTest.js", "src/selector/selectorTest.js", - "src/event/eventTest.js", - "src/fx/fxTest.js" + "src/event/eventTest.js" + //"src/fx/fxTest.js", //"src/ajax/ajaxTest.js" ); // Display the results results(); -}; \ No newline at end of file +}; diff --git a/build/test/data/dashboard.xml b/build/test/data/dashboard.xml index d2305593d..10f6b3347 100644 --- a/build/test/data/dashboard.xml +++ b/build/test/data/dashboard.xml @@ -1,11 +1,11 @@ - - + + - - - - - - - - \ No newline at end of file + + + + + + + + diff --git a/build/test/data/test.html b/build/test/data/test.html new file mode 100644 index 000000000..fc6dc3860 --- /dev/null +++ b/build/test/data/test.html @@ -0,0 +1,7 @@ +html text
+ + +blabla diff --git a/build/test/data/test.js b/build/test/data/test.js index 6ff89dd49..f8bdd091e 100644 --- a/build/test/data/test.js +++ b/build/test/data/test.js @@ -1,3 +1,3 @@ -foobar = "bar"; +var foobar = "bar"; $('#ap').html('bar'); -ok( true, "test.js executed"); \ No newline at end of file +ok( true, "test.js executed"); diff --git a/build/test/data/test2.html b/build/test/data/test2.html new file mode 100644 index 000000000..ebf610e43 --- /dev/null +++ b/build/test/data/test2.html @@ -0,0 +1,5 @@ + diff --git a/build/test/data/test2.php b/build/test/data/test2.php deleted file mode 100644 index 95547fecd..000000000 --- a/build/test/data/test2.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/build/test/data/testrunner.js b/build/test/data/testrunner.js index e6cfc1eb0..25ffb3f27 100644 --- a/build/test/data/testrunner.js +++ b/build/test/data/testrunner.js @@ -13,6 +13,8 @@ var _config = { asyncTimeout: 2 // seconds for async timeout }; +var isLocal = !!(window.location.protocol == 'file:'); + $(function() { $('#userAgent').html(navigator.userAgent); runTest(); @@ -39,13 +41,17 @@ function stop(allowFailure) { ok( false, "Test timed out" ); start(); }; - _config.timeout = setTimeout(handler, _config.asyncTimeout * 1000); + // Disabled, caused too many random errors + //_config.timeout = setTimeout(handler, _config.asyncTimeout * 1000); } function start() { - if(_config.timeout) - clearTimeout(_config.timeout); - _config.blocking = false; - process(); + // A slight delay, to avoid any current callbacks + setTimeout(function(){ + if(_config.timeout) + clearTimeout(_config.timeout); + _config.blocking = false; + process(); + }, 13); } function runTest() { @@ -271,7 +277,7 @@ function url(value) { * @param Object actual * @param String message (optional) */ -function equals(expected, actual, message) { +function equals(actual, expected, message) { var result = expected == actual; message = message || (result ? "okay" : "failed"); _config.Test.push( [ result, result ? message + ": " + expected : message + " expected: " + expected + " actual: " + actual ] ); diff --git a/build/test/index.html b/build/test/index.html index 4d79f3882..746c08ec9 100644 --- a/build/test/index.html +++ b/build/test/index.html @@ -9,7 +9,7 @@ - + -- cgit v1.2.3