Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Unified Diff: sky/tests/framework/flights-app-pixels.sky

Issue 792883008: Deflake flights-app-pixels.sky. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: merge to ToT Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/tests/framework/flights-app-pixels-expected.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | sky/tests/framework/flights-app-pixels-expected.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698