@@ -428,23 +428,15 @@ class FractalBoxesStage extends Stage {
428428 this . _complexity = 0 ;
429429 }
430430
431- initialize ( benchmark , options )
431+ async initialize ( benchmark , options )
432432 {
433- super . initialize ( benchmark , options ) ;
433+ await super . initialize ( benchmark , options ) ;
434434 this . controller = new FractalBoxesController ( this ) ;
435435
436436 this . images = [ ] ;
437- this . #startLoadingData ( benchmark )
437+ await this . #loadImages ( )
438438 }
439439
440- #startLoadingData( benchmark )
441- {
442- setTimeout ( async ( ) => {
443- await this . #loadImages( ) ;
444- benchmark . readyPromise . resolve ( ) ;
445- } , 0 ) ;
446- }
447-
448440 async #loadImages( )
449441 {
450442 const promises = [ ] ;
@@ -490,12 +482,6 @@ class FractalBoxesBenchmark extends Benchmark {
490482 const stage = document . getElementById ( 'stage' ) ;
491483 super ( new FractalBoxesStage ( stage ) , options ) ;
492484 }
493-
494- waitUntilReady ( )
495- {
496- this . readyPromise = new SimplePromise ;
497- return this . readyPromise ;
498- }
499485}
500486
501487window . benchmarkClass = FractalBoxesBenchmark ;
@@ -525,13 +511,13 @@ class FakeController {
525511}
526512
527513// Testing
528- window . addEventListener ( 'load' , ( ) => {
514+ window . addEventListener ( 'load' , async ( ) => {
529515 if ( ! ( window === window . parent ) )
530516 return ;
531517
532518 var benchmark = new window . benchmarkClass ( { } ) ;
519+ await benchmark . initialize ( { } ) ;
533520 benchmark . _controller = new FakeController ( benchmark ) ;
534-
535521 benchmark . run ( ) . then ( function ( testData ) {
536522
537523 } ) ;
0 commit comments