Ticket #4242: 4242_2.patch
File 4242_2.patch, 2.3 KB (added by , 15 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 YAHOO.tool.TestCase.Wait = native.Wait; 33 } )(); 34 35 (function() 36 { 8 37 var createLogger = function() 9 38 { 10 39 document.body.appendChild( document.createElement( 'div' ) ).id = 'testLogger'; … … 17 46 div.innerHTML = text; 18 47 }; 19 48 49 var runner = YAHOO.tool.TestRunner; 50 // Report runner status to cell. 51 if ( CKTester.cell ) 52 { 53 runner.subscribe( runner.TEST_CASE_BEGIN_EVENT, CKTester.cell.start ); 54 runner.subscribe( runner.TEST_CASE_COMPLETE_EVENT, CKTester.cell.complete ); 55 } 56 20 57 var htmlEncode = function( data ) 21 58 { 22 59 if ( typeof data != 'string' ) … … 31 68 window.onload = function() 32 69 { 33 70 createLogger(); 34 var runner = YAHOO.tool.TestRunner;35 71 36 72 var handleTestResult = function( data ) 37 73 { … … 66 102 runner.subscribe(runner.TEST_IGNORE_EVENT, handleTestResult); 67 103 runner.subscribe(runner.TEST_PASS_EVENT, handleTestResult); 68 104 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 105 // Whether control the runner manually instead of running on window onload. 76 106 !runner.defer && runner.run(); 77 107 };