Skip to content

Commit 221b190

Browse files
committed
Rebase
1 parent 43d9390 commit 221b190

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

MotionMark/tests/dev/stories/resources/stories.js

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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

501487
window.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
});

MotionMark/tests/dev/stories/stories.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@
109109
<script src="../../../resources/extensions.js"></script>
110110
<script src="../../../resources/statistics.js"></script>
111111
<script src="../../resources/math.js"></script>
112-
<script src="../../resources/main.js"></script>
112+
<script src="../../resources/benchmark.js"></script>
113+
<script src="../../resources/controllers.js"></script>
114+
<script src="../../resources/stage.js"></script>
113115
<script src="resources/stories.js"></script>
114116
</body>
115117
</html>

0 commit comments

Comments
 (0)