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) {
271
271
'use strict' ;
272
272
273
273
samples . forEach ( function ( t ) {
274
- it ( 'turn: ' + t , function ( ) {
274
+ it ( 'turn: ' + t , function ( done ) {
275
275
var startTime , endTime ;
276
276
277
277
requestAnimationFrame ( function ( ) {
278
278
// Wait for actual rendering instead of promise
279
279
requestAnimationFrame ( function ( ) {
280
280
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 ( ) ;
281
300
} ) ;
282
301
} ) ;
283
302
@@ -286,22 +305,6 @@ tests.forEach(function(spec, index) {
286
305
startTime = performance . now ( ) ;
287
306
288
307
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
- }
305
308
} ) ;
306
309
} ) ;
307
310
} ) ;
You can’t perform that action at this time.
0 commit comments