Updated testsuite: To prevent crashes in Safari, each test waits for 250 milliseconds...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Sun, 14 Jan 2007 22:36:54 +0000 (22:36 +0000)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Sun, 14 Jan 2007 22:36:54 +0000 (22:36 +0000)
build/test/data/testrunner.js
build/test/index.html

index 0ff0ad5..e73fd67 100644 (file)
@@ -15,6 +15,8 @@ var _config = {
 
 $(function() {
        $('#userAgent').html(navigator.userAgent);
 
 $(function() {
        $('#userAgent').html(navigator.userAgent);
+       if($.browser.safari)
+               $("h1").append("&nbsp;- Slowed down for Safari to prevent crashes");
        runTest();      
 });
 
        runTest();      
 });
 
@@ -63,9 +65,18 @@ function runTest() {
        });
 }
 
        });
 }
 
-function test(name, callback) {
+function test(name, callback, nowait) {
+       // safari seems to have some memory problems, so we need to slow it down
+       if($.browser.safari && !nowait) {
+               test("", function() {
+                       stop();
+                       setTimeout(start, 250);
+               }, true);
+       }
+
        if(_config.currentModule)
                name = _config.currentModule + " module: " + name;
        if(_config.currentModule)
                name = _config.currentModule + " module: " + name;
+               
        synchronize(function() {
                _config.Test = [];
                try {
        synchronize(function() {
                _config.Test = [];
                try {
@@ -82,6 +93,9 @@ function test(name, callback) {
        synchronize(function() {
                reset();
                
        synchronize(function() {
                reset();
                
+               // don't output pause tests
+               if(nowait) return;
+               
                if(_config.expected && _config.expected != _config.Test.length) {
                        _config.Test.push( [ false, "Expected " + _config.expected + " assertions, but " + _config.Test.length + " were run" ] );
                }
                if(_config.expected && _config.expected != _config.Test.length) {
                        _config.Test.push( [ false, "Expected " + _config.expected + " assertions, but " + _config.Test.length + " were run" ] );
                }
index 9718ece..ffeb9f9 100644 (file)
@@ -12,7 +12,7 @@
 </head>
 
 <body id="body">
 </head>
 
 <body id="body">
-       <h1>jQuery Test Suite - Core</h1>
+       <h1>jQuery Test Suite</h1>
        <h2 id="banner"></h2>
        <h2 id="userAgent"></h2>
        
        <h2 id="banner"></h2>
        <h2 id="userAgent"></h2>