@@ -428,23 +428,15 @@ class FractalBoxesStage extends Stage {
428
428
this . _complexity = 0 ;
429
429
}
430
430
431
- initialize ( benchmark , options )
431
+ async initialize ( benchmark , options )
432
432
{
433
- super . initialize ( benchmark , options ) ;
433
+ await super . initialize ( benchmark , options ) ;
434
434
this . controller = new FractalBoxesController ( this ) ;
435
435
436
436
this . images = [ ] ;
437
- this . #startLoadingData ( benchmark )
437
+ await this . #loadImages ( )
438
438
}
439
439
440
- #startLoadingData( benchmark )
441
- {
442
- setTimeout ( async ( ) => {
443
- await this . #loadImages( ) ;
444
- benchmark . readyPromise . resolve ( ) ;
445
- } , 0 ) ;
446
- }
447
-
448
440
async #loadImages( )
449
441
{
450
442
const promises = [ ] ;
@@ -490,12 +482,6 @@ class FractalBoxesBenchmark extends Benchmark {
490
482
const stage = document . getElementById ( 'stage' ) ;
491
483
super ( new FractalBoxesStage ( stage ) , options ) ;
492
484
}
493
-
494
- waitUntilReady ( )
495
- {
496
- this . readyPromise = new SimplePromise ;
497
- return this . readyPromise ;
498
- }
499
485
}
500
486
501
487
window . benchmarkClass = FractalBoxesBenchmark ;
@@ -525,13 +511,13 @@ class FakeController {
525
511
}
526
512
527
513
// Testing
528
- window . addEventListener ( 'load' , ( ) => {
514
+ window . addEventListener ( 'load' , async ( ) => {
529
515
if ( ! ( window === window . parent ) )
530
516
return ;
531
517
532
518
var benchmark = new window . benchmarkClass ( { } ) ;
519
+ await benchmark . initialize ( { } ) ;
533
520
benchmark . _controller = new FakeController ( benchmark ) ;
534
-
535
521
benchmark . run ( ) . then ( function ( testData ) {
536
522
537
523
} ) ;
0 commit comments