| 
									
										
										
										
											2015-10-13 00:29:13 -07:00
										 |  |  | import {runClickBenchmark, verifyNoBrowserErrors} from 'angular2/src/testing/perf_util'; | 
					
						
							| 
									
										
										
										
											2015-05-29 21:40:15 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | describe('ng2 element injector benchmark', function() { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   var URL = 'benchmarks/src/element_injector/element_injector_benchmark.html'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-30 08:17:27 -07:00
										 |  |  |   afterEach(verifyNoBrowserErrors); | 
					
						
							| 
									
										
										
										
											2015-05-29 21:40:15 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   it('should log the stats for instantiate', function(done) { | 
					
						
							| 
									
										
										
										
											2015-05-30 08:17:27 -07:00
										 |  |  |     runClickBenchmark({ | 
					
						
							|  |  |  |       url: URL, | 
					
						
							|  |  |  |       buttons: ['#instantiate'], | 
					
						
							|  |  |  |       id: 'ng2.elementInjector.instantiate', | 
					
						
							|  |  |  |       params: [{name: 'iterations', value: 20000, scale: 'linear'}], | 
					
						
							| 
									
										
										
										
											2015-08-27 17:44:59 +02:00
										 |  |  |       microMetrics: {'instantiateAvg': 'avg time for injection (in ms)'}, | 
					
						
							|  |  |  |       waitForAngular2: false | 
					
						
							| 
									
										
										
										
											2015-05-30 08:17:27 -07:00
										 |  |  |     }).then(done, done.fail); | 
					
						
							| 
									
										
										
										
											2015-05-29 21:40:15 -07:00
										 |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   it('should log the stats for hydrate', function(done) { | 
					
						
							| 
									
										
										
										
											2015-05-30 08:17:27 -07:00
										 |  |  |     runClickBenchmark({ | 
					
						
							|  |  |  |       url: URL, | 
					
						
							|  |  |  |       buttons: ['#hydrate'], | 
					
						
							|  |  |  |       id: 'ng2.elementInjector.hydrate', | 
					
						
							|  |  |  |       params: [{name: 'iterations', value: 20000, scale: 'linear'}], | 
					
						
							| 
									
										
										
										
											2015-08-27 17:44:59 +02:00
										 |  |  |       microMetrics: {'instantiateAvg': 'avg time for injection (in ms)'}, | 
					
						
							|  |  |  |       waitForAngular2: false | 
					
						
							| 
									
										
										
										
											2015-05-30 08:17:27 -07:00
										 |  |  |     }).then(done, done.fail); | 
					
						
							| 
									
										
										
										
											2015-05-29 21:40:15 -07:00
										 |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }); |