r3206 committed - inject testswarm agent when the test is run by testswarm

r3206 committed - inject testswarm agent when the test is run by testswarm


Revision: 3206
Author: joern.zaefferer
Date: Fri Sep 11 11:22:52 2009
Log: inject testswarm agent when the test is run by testswarm
http://code.google.com/p/jquery-ui/source/detail?r=3206
Modified:
/trunk/tests/unit/testsuite.js
=======================================
--- /trunk/tests/unit/testsuite.js    Fri Apr 17 14:28:37 2009
+++ /trunk/tests/unit/testsuite.js    Fri Sep 11 11:22:52 2009
@@ -91,3 +91,13 @@
    testSettingOptions(widget, options);
    testWidgetOverrides(widget);
}
+
+// 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("<scr" + "ipt src='http://testswarm.com/js/inject.js?"
+ (new Date).getTime() + "'></scr" + "ipt>");
+})();