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

Side by Side Diff: sky/tests/framework/flights-app.sky

Issue 817853006: Deflake flights-app.sky. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | sky/tests/framework/flights-app-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <sky> 1 <sky>
2 <import src="../resources/run-after-display.sky" as="runAfterDisplay" />
2 <import src="/sky/examples/flights-app/flights-app.sky" /> 3 <import src="/sky/examples/flights-app/flights-app.sky" />
3 <script> 4 <script>
5 var app;
6
7 function imagesLoaded() {
8 var images = app.shadowRoot.querySelectorAll('img');
9 for (var i = 0; i < images.length; i++) {
10 if (!images[i].complete)
11 return false;
12 }
13 return true;
14 }
15
16 function checkImagesLoaded() {
17 if (!imagesLoaded()) {
18 setTimeout(checkImagesLoaded, 10);
19 return;
20 }
21 runAfterDisplay(function() {
22 internals.notifyTestComplete(internals.renderTreeAsText());
23 });
24 }
25
4 addEventListener("load", function() { 26 addEventListener("load", function() {
5 var app = document.createElement("flights-app"); 27 app = document.createElement("flights-app");
6 document.querySelector("sky").appendChild(app); 28 document.querySelector("sky").appendChild(app);
7 internals.notifyTestComplete(internals.renderTreeAsText()); 29 checkImagesLoaded();
8 }); 30 });
9 </script> 31 </script>
10 </sky> 32 </sky>
OLDNEW
« no previous file with comments | « no previous file | sky/tests/framework/flights-app-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698