2016-04-28 17:50:03 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								import {runBenchmark, verifyNoBrowserErrors} from '@angular/testing/src/perf_util';
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-27 09:53:22 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-03 10:04:27 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								describe('ng-dart1.x naive infinite scroll benchmark', function() {
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-27 09:53:22 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-02 16:25:34 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  var URL = 'benchmarks_external/src/naive_infinite_scroll/index.html';
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-27 09:53:22 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-03 10:04:27 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  afterEach(verifyNoBrowserErrors);
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-27 09:53:22 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  [1, 2, 4].forEach(function(appSize) {
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-03 10:04:27 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    it('should run scroll benchmark and collect stats for appSize = ' + appSize, function(done) {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      runBenchmark({
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-27 09:53:22 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        url: URL,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        id: 'ng1-dart1.x.naive_infinite_scroll',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        work: function() {
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-27 09:07:16 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								          $('#reset-btn').click();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								          $('#run-btn').click();
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-05 18:33:57 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								          var s = 1000;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								          if (appSize > 4) {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            s = s + appSize * 100;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								          }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								          browser.sleep(s);
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-27 09:53:22 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        },
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-03 10:04:27 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        params: [
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-12 09:40:37 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								          {name: 'appSize', value: appSize},
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								          {name: 'iterationCount', value: 20, scale: 'linear'},
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-03 10:04:27 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								          {name: 'scrollIncrement', value: 40}
							 | 
						
					
						
							
								
									
										
										
										
											2015-08-27 17:44:59 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        ],
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        waitForAngular2: false
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-11 10:13:49 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      }).then(done, done.fail);
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-27 09:53:22 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    });
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  });
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								});
							 |