]> source.dussan.org Git - jquery-ui.git/commitdiff
Update to official qunit composite addon
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Sat, 21 Apr 2012 15:49:11 +0000 (17:49 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Sat, 21 Apr 2012 15:49:11 +0000 (17:49 +0200)
26 files changed:
tests/unit/accordion/all.html
tests/unit/all-active.html
tests/unit/all.html
tests/unit/autocomplete/all.html
tests/unit/button/all.html
tests/unit/core/all.html
tests/unit/datepicker/all.html
tests/unit/dialog/all.html
tests/unit/draggable/all.html
tests/unit/droppable/all.html
tests/unit/effects/all.html
tests/unit/menu/all.html
tests/unit/position/all.html
tests/unit/progressbar/all.html
tests/unit/qunit-composite.css [new file with mode: 0644]
tests/unit/qunit-composite.js [new file with mode: 0644]
tests/unit/resizable/all.html
tests/unit/selectable/all.html
tests/unit/slider/all.html
tests/unit/sortable/all.html
tests/unit/spinner/all.html
tests/unit/subsuiteRunner.css [deleted file]
tests/unit/subsuiteRunner.js [deleted file]
tests/unit/tabs/all.html
tests/unit/tooltip/all.html
tests/unit/widget/all.html

index ec9c003d9b13b85d18a39bcaa89e9b7b7d51f470..2fb783c1cbfef7012c15ad1cd4eb6693f4cc1906 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index 89c10441d75eba1f3e5798da8ee13d9437bf8563..b3e2fbcba14d5d1a7dc6bd4800602ad0e8be6c9d 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../external/qunit.css">
-       <link rel="stylesheet" href="subsuiteRunner.css">
+       <link rel="stylesheet" href="qunit-composite.css">
        <script src="../../external/qunit.js"></script>
-       <script src="subsuiteRunner.js"></script>
+       <script src="qunit-composite.js"></script>
 
        <script>
        (function() {
index e48b1ac0e79291fa0f166f808c1594f426452363..6d98df0f976dd6f9e2a3dc002cd14d3a45f4cb14 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../external/qunit.css">
-       <link rel="stylesheet" href="subsuiteRunner.css">
+       <link rel="stylesheet" href="qunit-composite.css">
        <script src="../../external/qunit.js"></script>
-       <script src="subsuiteRunner.js"></script>
+       <script src="qunit-composite.js"></script>
 
        <script>
        (function() {
index 87cde75fb5f59e8bbf6a3599e29b601b72954eca..e35777f65b94b3ff1f2ac6425bd71ba774f0713a 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index 115743e94151d451cbb9a4ae0d6f8f03ce33b4c3..6c46c965056f6d89905fa5042f1c87c52c28c671 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index 78bbe9aefe1364d7ea3b15987b40e6dc396c18f8..e31d6905c09deafca2a76e353574a738cebe2ef8 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index 1540705f86943bed8f2001bfb315749f53a49d48..c62c7c07ddc169de9d140921b261b6a05c4e5b11 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index 973119c08c1a5153faad6e62a135ce4ee581529c..b1c69c6c9f5324acdea30f2e1f268f0626941f92 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index 1b2a511a52f1beca83576b3185205367c22ceeba..75df351ad6cfbaff1808d08fce1f15ecc81f411f 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index 535f41521257461e440f24b9d577a18b239a58ec..aa24ed7e1bc8e96da06fed68298e3210f2a6c7c6 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index 0ef901292cd9c0a82517735c85bd64b3fec75901..59500588c54411c1870a1c09128946b88229c5cc 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index a58e152990bbe48088580bf04640fe33e0160fa0..475c1b7178af0f898817fb9f31c6411b6b0ccdd4 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index fa3ecf23d5ae30d6a40f129a31e4e391189910d1..d76f9bbd87506fac0e74d89b08ef3c98a166b56e 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index eefb9c13526fca0fb10a98183b70adc81f5374f5..16b9e0acee714cbfb46baf2c05df6328383a7adc 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
diff --git a/tests/unit/qunit-composite.css b/tests/unit/qunit-composite.css
new file mode 100644 (file)
index 0000000..df47362
--- /dev/null
@@ -0,0 +1,13 @@
+iframe.qunit-subsuite{
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    
+    margin: 0;
+    padding: 0;
+    border-width: 1px 0 0;
+    height: 45%;
+    width: 100%;
+
+    background: #fff;
+}
\ No newline at end of file
diff --git a/tests/unit/qunit-composite.js b/tests/unit/qunit-composite.js
new file mode 100644 (file)
index 0000000..5b753e2
--- /dev/null
@@ -0,0 +1,102 @@
+(function( QUnit ) {
+
+QUnit.extend( QUnit, {
+       testSuites: function( suites ) {
+               QUnit.begin(function() {
+                       QUnit.initIframe();
+               });
+
+               for ( var i = 0; i < suites.length; i++ ) {
+                       (function( suite ) {
+                               asyncTest( suite, function() {
+                                       QUnit.runSuite( suite );
+                               });
+                       }( suites[i] ) );
+               }
+               QUnit.done(function() {
+                       this.iframe.style.display = "none";
+               });
+       },
+
+       runSuite: function( suite ) {
+               this.iframe.setAttribute( "src", suite );
+       },
+
+       initIframe: function() {
+               var body = document.body,
+                       iframe = this.iframe = document.createElement( "iframe" ),
+                       iframeWin;
+
+               iframe.className = "qunit-subsuite";
+               body.appendChild( iframe );
+
+               function onIframeLoad() {
+                       var module, test,
+                               count = 0;
+
+
+                       iframeWin.QUnit.moduleStart(function( data ) {
+                               // capture module name for messages
+                               module = data.name;
+                       });
+
+                       iframeWin.QUnit.testStart(function( data ) {
+                               // capture test name for messages
+                               test = data.name;
+                       });
+                       iframeWin.QUnit.testDone(function() {
+                               test = null;
+                       });
+
+                       iframeWin.QUnit.log(function( data ) {
+                               if (test === null) {
+                                       return;
+                               }
+                               // pass all test details through to the main page
+                               var message = module + ": " + test + ": " + data.message;
+                               expect( ++count );
+                               QUnit.push( data.result, data.actual, data.expected, message );
+                       });
+
+                       iframeWin.QUnit.done(function() {
+                               // start the wrapper test from the main page
+                               start();
+                       });
+               }
+               QUnit.addEvent( iframe, "load", onIframeLoad );
+
+               iframeWin = iframe.contentWindow;
+       }
+});
+
+QUnit.testStart(function( data ) {
+       // update the test status to show which test suite is running
+       QUnit.id( "qunit-testresult" ).innerHTML = "Running " + data.name + "...<br>&nbsp;";
+});
+
+QUnit.testDone(function() {
+       var current = QUnit.id( this.config.current.id ),
+               children = current.children,
+               src = this.iframe.src;
+
+       // undo the auto-expansion of failed tests
+       for ( var i = 0; i < children.length; i++ ) {
+               if ( children[i].nodeName === "OL" ) {
+                       children[i].style.display = "none";
+               }
+       }
+
+       QUnit.addEvent(current, "dblclick", function( e ) {
+               var target = e && e.target ? e.target : window.event.srcElement;
+               if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) {
+                       target = target.parentNode;
+               }
+               if ( window.location && target.nodeName.toLowerCase() === "strong" ) {
+                       window.location = src;
+               }
+       });
+
+       current.getElementsByTagName('a')[0].href = src;
+});
+
+}( QUnit ) );
index 1c68112826ea973acc032135272c562620965b35..bef29ff6eb41aa09e936760ffd2440a4c404fa8b 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index bfebf46c2fb385824748b5b25955b681b3f9c0e1..51778e771c131457ad8abf0cf7384c600debbe02 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index 5aac26ced52fad412954c33618d54ea76a85ccb3..bfadc03804cdbca6c21aad4a8e882fa0fdffa37a 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index 89e2392508901c09549d8e25e62422dbea3722f9..f9d63d62e40df73dee7f7e0cf25bb1994008cf94 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index e41e088c47450824eafd62b40edd5cae2cee84c4..72a2dd77a3fe9826f1cb014bedc283cf0cd74bf6 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
diff --git a/tests/unit/subsuiteRunner.css b/tests/unit/subsuiteRunner.css
deleted file mode 100644 (file)
index bca30a7..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-iframe.qunit-subsuite {
-       margin: 0;
-       padding: 0;
-       border-width: 1px 0 0;
-       height: 600px;
-       width: 100%;
-       background: #fff;
-}
\ No newline at end of file
diff --git a/tests/unit/subsuiteRunner.js b/tests/unit/subsuiteRunner.js
deleted file mode 100644 (file)
index 2d6de2d..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-(function( QUnit ) {
-
-var subsuiteFrame;
-
-QUnit.extend( QUnit, {
-       testSuites: function( suites ) {
-               function generateSuite( suite ) {
-                       asyncTest( suite, function() {
-                               QUnit.runSuite( suite );
-                       });
-               }
-
-               for ( var i = 0; i < suites.length; i++ ) {
-                       generateSuite( suites[ i ] );
-               }
-
-               QUnit.done = function() {
-                       subsuiteFrame.style.display = "none";
-               };
-       },
-
-       testStart: function( data ) {
-               // update the test status to show which test suite is running
-               QUnit.id( "qunit-testresult" ).innerHTML = "Running " + data.name + "...<br>&nbsp;";
-       },
-
-       testDone: function() {
-               var current = QUnit.id( this.config.current.id ),
-                       children = current.children,
-                       i = 0,
-                       length = children.length;
-
-               // undo the auto-expansion of failed tests
-               for ( ; i < length; i++ ) {
-                       if ( children[i].nodeName === "OL" ) {
-                               children[i].style.display = "none";
-                       }
-               }
-       },
-
-       runSuite: function( suite ) {
-               var iframeWin,
-                       body = document.getElementsByTagName( "body" )[0],
-                       iframe = document.createElement( "iframe" );
-
-               subsuiteFrame = iframe;
-               iframe.className = "qunit-subsuite";
-               body.appendChild( iframe );
-
-               function onIframeLoad() {
-                       var module, test,
-                               count = 0;
-
-                       QUnit.extend( iframeWin.QUnit, {
-                               moduleStart: function( data ) {
-                                       // capture module name for messages
-                                       module = data.name;
-                               },
-
-                               testStart: function( data ) {
-                                       // capture test name for messages
-                                       test = data.name;
-                               },
-
-                               log: function( data ) {
-                                       // pass all test details through to the main page
-                                       var message = module + ": " + test + ": " + data.message;
-                                       expect( ++count );
-                                       QUnit.push( data.result, data.actual, data.expected, message );
-                               },
-
-                               done: function() {
-                                       // start the wrapper test from the main page
-                                       start();
-                               }
-                       });
-               }
-               QUnit.addEvent( iframe, "load", onIframeLoad );
-
-               iframeWin = iframe.contentWindow;
-               iframe.setAttribute( "src", suite );
-
-               this.runSuite = function( suite ) {
-                       iframe.setAttribute( "src", suite );
-               };
-       }
-});
-}( QUnit ) );
index 1da3ecad2846c0f2d675dd524caffc604de3ae92..41bf965f219f6a88de49a47abe36da5c385c3ad8 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index deb628e2f8285d178c7fc946cadab053cab34265..c1aa35acf74bf6d5ab270c9ffef8f6d65ffa5527 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>
index cad4bdd72a6bbbaac39981e341b02a95e5cd6864..e5b16c8d721020b9a0c377df54010e01b35562eb 100644 (file)
@@ -7,9 +7,9 @@
        <script src="../../../jquery-1.7.2.js"></script>
 
        <link rel="stylesheet" href="../../../external/qunit.css">
-       <link rel="stylesheet" href="../subsuiteRunner.css">
+       <link rel="stylesheet" href="../qunit-composite.css">
        <script src="../../../external/qunit.js"></script>
-       <script src="../subsuiteRunner.js"></script>
+       <script src="../qunit-composite.js"></script>
        <script src="../subsuite.js"></script>
 
        <script>