| Index: sky/tests/framework/flights-app.sky
|
| diff --git a/sky/tests/framework/flights-app.sky b/sky/tests/framework/flights-app.sky
|
| index e42ff36e275ee78bdd0f8258969f5dafdb00ba9e..826ab772913446f09b7f44ac997e46a8d0f111c6 100644
|
| --- a/sky/tests/framework/flights-app.sky
|
| +++ b/sky/tests/framework/flights-app.sky
|
| @@ -1,10 +1,32 @@
|
| <sky>
|
| + <import src="../resources/run-after-display.sky" as="runAfterDisplay" />
|
| <import src="/sky/examples/flights-app/flights-app.sky" />
|
| <script>
|
| + var app;
|
| +
|
| + function imagesLoaded() {
|
| + var images = app.shadowRoot.querySelectorAll('img');
|
| + for (var i = 0; i < images.length; i++) {
|
| + if (!images[i].complete)
|
| + return false;
|
| + }
|
| + return true;
|
| + }
|
| +
|
| + function checkImagesLoaded() {
|
| + if (!imagesLoaded()) {
|
| + setTimeout(checkImagesLoaded, 10);
|
| + return;
|
| + }
|
| + runAfterDisplay(function() {
|
| + internals.notifyTestComplete(internals.renderTreeAsText());
|
| + });
|
| + }
|
| +
|
| addEventListener("load", function() {
|
| - var app = document.createElement("flights-app");
|
| + app = document.createElement("flights-app");
|
| document.querySelector("sky").appendChild(app);
|
| - internals.notifyTestComplete(internals.renderTreeAsText());
|
| + checkImagesLoaded();
|
| });
|
| </script>
|
| </sky>
|
|
|