Allow passing an optional timeout to Testability's whenStable(). If specified, if Angular is not stable before the timeout is hit, the done callback will be invoked with a list of pending macrotasks. Also, allows an optional update callback, which will be invoked whenever the set of pending macrotasks changes. If this callback returns true, the timeout will be cancelled and the done callback will not be invoked. If the optional parameters are not passed, whenStable() will work as it did before, whether or not the task tracking zone spec is available. This change also migrates the Testability unit tests off the deprecated AsyncTestCompleter. PR Close #16863
		
			
				
	
	
		
			22 lines
		
	
	
		
			711 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			711 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| /**
 | |
|  * @license
 | |
|  * Copyright Google Inc. All Rights Reserved.
 | |
|  *
 | |
|  * Use of this source code is governed by an MIT-style license that can be
 | |
|  * found in the LICENSE file at https://angular.io/license
 | |
|  */
 | |
| (function(global: any) {
 | |
|   writeScriptTag('/vendor/zone.js');
 | |
|   writeScriptTag('/vendor/task-tracking.js');
 | |
|   writeScriptTag('/vendor/system.js');
 | |
|   writeScriptTag('/vendor/Reflect.js');
 | |
|   writeScriptTag('/_common/system-config.js');
 | |
|   if (location.pathname.indexOf('/upgrade/') != -1) {
 | |
|     writeScriptTag('/vendor/angular.js');
 | |
|   }
 | |
| 
 | |
|   function writeScriptTag(scriptUrl: string, onload: string = '') {
 | |
|     document.write('<script src="' + scriptUrl + '" onload="' + onload + '"></script>');
 | |
|   }
 | |
| }(window));
 |