Speedometer 2.0: Flight.js test is sometime broken
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 May 2017 10:05:13 +0000 (10:05 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 May 2017 10:05:13 +0000 (10:05 +0000)
commit0c8c5107a5fefe6a0b247973b953a5593b2f7605
tree8aef20cdbb9051d055cdfdc33a64d3c0a63e3f75
parent185a9777e11b76b55435fac0cbf85af6afcdd1d6
Speedometer 2.0: Flight.js test is sometime broken
https://bugs.webkit.org/show_bug.cgi?id=172347

Reviewed by Antti Koivisto.

The bug was caused by the test runner only waiting for #new-todo, which happens before all other states are
updated in the Flight.js dependency example. As done in Speedometer v1, insert a dummy element with id set
to appIsReady and wait for this element to appear in the benchmark harness.

* Speedometer/resources/tests.js: Wait for #appIsReady.
* Speedometer/resources/todomvc/dependency-examples/flight/flight/app/js/main.js: Removed the superflous call
to console.log.
(checkReady): Added. Insert #appIsReady if checkLoaded is no longer running at 50ms interval. Because this
could happen asynchronously, we check the absense of checkLoadedTimeoutId Î©every 10ms for 5 times for
the total duration of 50ms. If checkLoadedTimeoutId was never present, we call it ready. If we ever observed
the presence of checkLoadedTimeoutId, wait another 50ms and start over.
* Speedometer/resources/todomvc/dependency-examples/flight/flight/node_modules/requirejs/require.js:
(.newContext.checkLoaded): Expose checkLoadedTimeoutId which is a timer ID used to check the dependency.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PerformanceTests/ChangeLog
PerformanceTests/Speedometer/resources/tests.js
PerformanceTests/Speedometer/resources/todomvc/dependency-examples/flight/flight/app/js/main.js
PerformanceTests/Speedometer/resources/todomvc/dependency-examples/flight/flight/node_modules/requirejs/require.js