File tree Expand file tree Collapse file tree 1 file changed +20
-17
lines changed
test/jasmine/performance_tests Expand file tree Collapse file tree 1 file changed +20
-17
lines changed Original file line number Diff line number Diff line change @@ -271,13 +271,32 @@ tests.forEach(function(spec, index) {
271271 'use strict' ;
272272
273273 samples . forEach ( function ( t ) {
274- it ( 'turn: ' + t , function ( ) {
274+ it ( 'turn: ' + t , function ( done ) {
275275 var startTime , endTime ;
276276
277277 requestAnimationFrame ( function ( ) {
278278 // Wait for actual rendering instead of promise
279279 requestAnimationFrame ( function ( ) {
280280 endTime = performance . now ( ) ;
281+
282+ var delta = endTime - startTime ;
283+ console . log ( delta )
284+
285+ if ( t === 0 ) {
286+ tests [ index ] . raw = [ ] ;
287+ }
288+ tests [ index ] . raw [ t ] = delta ;
289+
290+ if ( spec . selector ) {
291+ var nodes = d3SelectAll ( spec . selector ) ;
292+ expect ( nodes . size ( ) ) . toEqual ( spec . nTraces ) ;
293+ }
294+
295+ if ( t === nTimes && index === tests . length - 1 ) {
296+ downloadCSV ( tests ) ;
297+ }
298+
299+ done ( ) ;
281300 } ) ;
282301 } ) ;
283302
@@ -286,22 +305,6 @@ tests.forEach(function(spec, index) {
286305 startTime = performance . now ( ) ;
287306
288307 Plotly . newPlot ( gd , mock ) ;
289-
290- var delta = endTime - startTime ;
291-
292- if ( t === 0 ) {
293- tests [ index ] . raw = [ ] ;
294- }
295- tests [ index ] . raw [ t ] = delta ;
296-
297- if ( spec . selector ) {
298- var nodes = d3SelectAll ( spec . selector ) ;
299- expect ( nodes . size ( ) ) . toEqual ( spec . nTraces ) ;
300- }
301-
302- if ( t === nTimes && index === tests . length - 1 ) {
303- downloadCSV ( tests ) ;
304- }
305308 } ) ;
306309 } ) ;
307310 } ) ;
You can’t perform that action at this time.
0 commit comments