| 
									
										
										
										
											2016-08-26 12:27:24 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @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
 | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2015-05-29 21:40:15 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 09:29:39 -07:00
										 |  |  | import {runBenchmark, verifyNoBrowserErrors} from 'e2e_util/perf_util'; | 
					
						
							| 
									
										
										
										
											2015-05-29 21:40:15 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 14:17:37 -07:00
										 |  |  | describe('tree benchmark perf', () => { | 
					
						
							| 
									
										
										
										
											2015-05-29 21:40:15 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-26 12:27:24 -07:00
										 |  |  |   afterEach(verifyNoBrowserErrors); | 
					
						
							| 
									
										
										
										
											2015-05-29 21:40:15 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 14:17:37 -07:00
										 |  |  |   it('should run for ng2', (done) => { | 
					
						
							|  |  |  |     runTreeBenchmark({ | 
					
						
							|  |  |  |       id: 'deepTree.ng2', | 
					
						
							|  |  |  |       url: 'all/benchmarks/src/tree/ng2/index.html', | 
					
						
							| 
									
										
										
										
											2016-08-30 09:29:39 -07:00
										 |  |  |     }).then(done, done.fail); | 
					
						
							| 
									
										
										
										
											2015-05-29 21:40:15 -07:00
										 |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 14:17:37 -07:00
										 |  |  |   it('should run for the baseline', (done) => { | 
					
						
							|  |  |  |     runTreeBenchmark({ | 
					
						
							|  |  |  |       id: 'deepTree.baseline', | 
					
						
							|  |  |  |       url: 'all/benchmarks/src/tree/baseline/index.html', | 
					
						
							|  |  |  |       ignoreBrowserSynchronization: true, | 
					
						
							| 
									
										
										
										
											2016-08-30 13:44:52 -07:00
										 |  |  |     }).then(done, done.fail); | 
					
						
							| 
									
										
										
										
											2015-05-29 21:40:15 -07:00
										 |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 14:17:37 -07:00
										 |  |  |   it('should run for polymer binary tree', (done) => { | 
					
						
							|  |  |  |     runTreeBenchmark({ | 
					
						
							| 
									
										
										
										
											2016-08-30 09:29:39 -07:00
										 |  |  |       id: 'deepTree.polymer', | 
					
						
							|  |  |  |       url: 'all/benchmarks/src/tree/polymer/index.html', | 
					
						
							|  |  |  |       ignoreBrowserSynchronization: true, | 
					
						
							| 
									
										
										
										
											2016-08-30 13:44:52 -07:00
										 |  |  |     }).then(done, done.fail); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 14:17:37 -07:00
										 |  |  |   it('should run for polymer leaves', (done) => { | 
					
						
							|  |  |  |     runTreeBenchmark({ | 
					
						
							| 
									
										
										
										
											2016-08-30 13:44:52 -07:00
										 |  |  |       id: 'deepTree.polymerLeaves', | 
					
						
							|  |  |  |       url: 'all/benchmarks/src/tree/polymer_leaves/index.html', | 
					
						
							|  |  |  |       ignoreBrowserSynchronization: true, | 
					
						
							| 
									
										
										
										
											2016-08-30 14:17:37 -07:00
										 |  |  |     }).then(done, done.fail); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   function runTreeBenchmark( | 
					
						
							|  |  |  |       config: {id: string, url: string, ignoreBrowserSynchronization?: boolean}) { | 
					
						
							|  |  |  |     return runBenchmark({ | 
					
						
							|  |  |  |       id: config.id, | 
					
						
							|  |  |  |       url: config.url, | 
					
						
							|  |  |  |       ignoreBrowserSynchronization: config.ignoreBrowserSynchronization, | 
					
						
							| 
									
										
										
										
											2016-08-30 13:44:52 -07:00
										 |  |  |       params: [{name: 'depth', value: 9}], | 
					
						
							|  |  |  |       work: () => { | 
					
						
							|  |  |  |         $('#createDom').click(); | 
					
						
							|  |  |  |         $('#destroyDom').click(); | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2016-08-30 14:17:37 -07:00
										 |  |  |     }); | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2015-05-29 21:40:15 -07:00
										 |  |  | }); |