Ticket #4242: 4242.patch
File 4242.patch, 2.2 KB (added by , 14 years ago) |
---|
-
_test/cktester/runners/yuitest/extension.js
3 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 4 */ 5 5 6 (function() 6 // Extending YUI TestCase functionality. 7 ( function() 7 8 { 9 var native = YAHOO.tool.TestCase; 10 YAHOO.tool.TestCase = function( template ) 11 { 12 // Ignore all tests from the template other than the one specified by 'ignoreAllBut'. 13 try 14 { 15 var only = template._should.ignoreAllBut; 16 if( only ) 17 { 18 delete template._should.ignoreAllBut; 19 var ignores = template._should.ignore = {}, match, test; 20 for ( test in template ) 21 { 22 if ( ( match = test.match( /^test(.*)/ ) ) && match[ 0 ] != only ) 23 ignores[ match[ 0 ] ] = true; 24 } 25 } 26 27 }catch( er ){} 28 29 return native.call( this, template ); 30 }; 31 YAHOO.tool.TestCase.prototype = native.prototype; 32 } )(); 33 34 (function() 35 { 8 36 var createLogger = function() 9 37 { 10 38 document.body.appendChild( document.createElement( 'div' ) ).id = 'testLogger'; … … 17 45 div.innerHTML = text; 18 46 }; 19 47 48 var runner = YAHOO.tool.TestRunner; 49 // Report runner status to cell. 50 if ( CKTester.cell ) 51 { 52 runner.subscribe( runner.TEST_CASE_BEGIN_EVENT, CKTester.cell.start ); 53 runner.subscribe( runner.TEST_CASE_COMPLETE_EVENT, CKTester.cell.complete ); 54 } 55 20 56 var htmlEncode = function( data ) 21 57 { 22 58 if ( typeof data != 'string' ) … … 31 67 window.onload = function() 32 68 { 33 69 createLogger(); 34 var runner = YAHOO.tool.TestRunner;35 70 36 71 var handleTestResult = function( data ) 37 72 { … … 66 101 runner.subscribe(runner.TEST_IGNORE_EVENT, handleTestResult); 67 102 runner.subscribe(runner.TEST_PASS_EVENT, handleTestResult); 68 103 69 if ( CKTester.cell )70 {71 runner.subscribe( runner.TEST_CASE_BEGIN_EVENT, CKTester.cell.start );72 runner.subscribe( runner.TEST_CASE_COMPLETE_EVENT, CKTester.cell.complete );73 }74 75 104 // Whether control the runner manually instead of running on window onload. 76 105 !runner.defer && runner.run(); 77 106 };