| Index: sky/tests/framework/flights-app-pixels.sky
|
| diff --git a/sky/tests/framework/flights-app-pixels.sky b/sky/tests/framework/flights-app-pixels.sky
|
| index ff06a09ebe7651fac03745a6ec64de08a814e052..3580417f6062de183cc9ac4a1ea4167eb06406fa 100644
|
| --- a/sky/tests/framework/flights-app-pixels.sky
|
| +++ b/sky/tests/framework/flights-app-pixels.sky
|
| @@ -2,12 +2,31 @@
|
| <import src="../resources/run-after-display.sky" as="runAfterDisplay" />
|
| <import src="/sky/examples/flights-app/flights-app.sky" />
|
| <script>
|
| - addEventListener("load", function() {
|
| - var app = document.createElement("flights-app");
|
| - document.querySelector("sky").appendChild(app);
|
| + 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("");
|
| });
|
| + }
|
| +
|
| + addEventListener("load", function() {
|
| + app = document.createElement("flights-app");
|
| + document.querySelector("sky").appendChild(app);
|
| + checkImagesLoaded();
|
| });
|
| </script>
|
| </sky>
|
|
|