Index: sky/tests/framework/flights-app-pixels.sky |
diff --git a/sky/examples/flights/index.sky b/sky/tests/framework/flights-app-pixels.sky |
similarity index 74% |
rename from sky/examples/flights/index.sky |
rename to sky/tests/framework/flights-app-pixels.sky |
index 00f43796567674fbf520f15441c6a180c6c4afcf..5ba9c40060d2a88e7047688182c93822e763a59a 100644 |
--- a/sky/examples/flights/index.sky |
+++ b/sky/tests/framework/flights-app-pixels.sky |
@@ -1,4 +1,5 @@ |
<app> |
+ <import src="../resources/run-after-display.sky" /> |
<style> |
* { box-sizing: border-box; } |
@@ -9,9 +10,9 @@ |
app { |
display: flex; |
flex-direction: column; |
- height: 100%; |
+ min-height: 100%; |
background-color: #494949; |
- font-family: sans-serif; |
+ font-family: "Helvetica", sans-serif; |
font-size: 16px; |
color: #2B2B2B; |
} |
@@ -91,7 +92,6 @@ |
right: 32px; |
max-width: 55%; |
box-shadow: 0px 0px 12px 2px rgba(22, 22, 22, 0.4); |
- background-color: #b0281a; |
background-image: linear-gradient(#E5D658, #DFCF43); |
border: 1px solid #AEA477; |
padding: 6px; |
@@ -99,6 +99,7 @@ |
display: flex; |
align-items: center; |
font-size: 0.8em; |
+ overflow: hidden; |
} |
app-toast-header { |
@@ -106,6 +107,16 @@ |
margin-right: 6px; |
} |
+ app-toast-close-box { |
+ position: absolute; |
+ top: 3px; |
+ right: 3px; |
+ width: 1em; |
+ overflow: hidden; |
+ text-align: center; |
+ outline: 1px solid #AEA477; |
+ } |
+ |
.tip-icon { |
font-weight: bold; |
font-size: 24px; |
@@ -127,6 +138,7 @@ |
.route-result { |
margin: 16px 16px 0 16px; |
+ outline: 1px solid black; |
} |
.route-title { |
@@ -167,13 +179,13 @@ |
<t>Search</t> |
</app-title> |
<app-menu-button> |
- <img src="images/menu-white.png" class="menu-icon"> |
+ <img src="resources/menu-white.png" class="menu-icon"> |
</app-menu-button> |
</app-header> |
<app-toolbar> |
<app-search-input> |
<span class="input-icon"> |
- <img src="/sky/examples/flights/images/magnifying-glass.png" style="width: 16px"> |
+ <img src="resources/magnifying-glass.png" style="width: 16px"> |
</span> |
<span class="input-text"><t>flights today to dc by price</t></span> |
</app-search-input> |
@@ -185,12 +197,12 @@ |
<t>SFO to DCA</t> |
</div> |
<app-menu-button> |
- <img src="images/menu-enabled.png" class="menu-icon-inner"> |
+ <img src="resources/menu-enabled.png" class="menu-icon-inner"> |
</app-menu-button> |
</app-panel-header> |
<app-panel-content class="airline"> |
<div class="airline-logo"> |
- <img class="airline-logo-image" src="images/virgin-america.jpg"> |
+ <img class="airline-logo-image" src="resources/virgin-america.jpg"> |
</div> |
<div class="airline-name"> |
<t>Virgin America</t> |
@@ -201,7 +213,7 @@ |
</app-panel-content> |
<app-panel-content class="airline"> |
<div class="airline-logo"> |
- <img class="airline-logo-image" src="images/ba.jpg"> |
+ <img class="airline-logo-image" src="resources/ba.jpg"> |
</div> |
<div class="airline-name"> |
<t>British Airways</t> |
@@ -212,7 +224,7 @@ |
</app-panel-content> |
<app-panel-content class="airline"> |
<div class="airline-logo"> |
- <img class="airline-logo-image" src="images/united.jpg"> |
+ <img class="airline-logo-image" src="resources/united.jpg"> |
</div> |
<div class="airline-name"> |
<t>United</t> |
@@ -223,7 +235,7 @@ |
</app-panel-content> |
<app-panel-content class="airline"> |
<div class="airline-logo"> |
- <img class="airline-logo-image" src="images/delta.jpg"> |
+ <img class="airline-logo-image" src="resources/delta.jpg"> |
</div> |
<div class="airline-name"> |
<t>Delta</t> |
@@ -239,12 +251,12 @@ |
<t>SJC to DCA</t> |
</div> |
<app-menu-button> |
- <img src="images/menu-enabled.png" class="menu-icon-inner"> |
+ <img src="resources/menu-enabled.png" class="menu-icon-inner"> |
</app-menu-button> |
</app-panel-header> |
<app-panel-content class="airline"> |
<div class="airline-logo"> |
- <img class="airline-logo-image" src="images/virgin-america.jpg"> |
+ <img class="airline-logo-image" src="resources/virgin-america.jpg"> |
</div> |
<div class="airline-name"> |
<t>Virgin America</t> |
@@ -255,7 +267,7 @@ |
</app-panel-content> |
<app-panel-content class="airline"> |
<div class="airline-logo"> |
- <img class="airline-logo-image" src="images/jetblue.jpg"> |
+ <img class="airline-logo-image" src="resources/jetblue.jpg"> |
</div> |
<div class="airline-name"> |
<t>jetBlue</t> |
@@ -266,7 +278,7 @@ |
</app-panel-content> |
<app-panel-content class="airline"> |
<div class="airline-logo"> |
- <img class="airline-logo-image" src="images/united.jpg"> |
+ <img class="airline-logo-image" src="resources/united.jpg"> |
</div> |
<div class="airline-name"> |
<t>United</t> |
@@ -286,5 +298,41 @@ |
<app-toast-content> |
<t>Flights are <span class="tip-price">$200</span> cheaper tomorrow.</t> |
</app-toast-content> |
+ <app-toast-close-box> |
+ X |
+ </app-toast-close-box> |
</app-toast> |
+ <script> |
+ import "dart:sky"; |
+ import "dart:sky.internals" as internals; |
+ import "dart:async"; |
+ |
+ var app; |
+ |
+ bool imagesLoaded() { |
+ var images = window.document.querySelectorAll('img'); |
+ for (var i = 0; i < images.length; i++) { |
+ if (!images[i].complete) |
+ return false; |
+ } |
+ return true; |
+ } |
+ |
+ void checkImagesLoaded() { |
+ if (!imagesLoaded()) { |
+ new Timer(new Duration(seconds:10), checkImagesLoaded); |
+ return; |
+ } |
+ runAfterDisplay(() { |
+ internals.notifyTestComplete(""); |
+ }); |
+ } |
+ void main() { |
+ window.addEventListener("load", (_) { |
+ var input = document.querySelector('.input-text'); |
+ window.getSelection().selectAllChildren(input.firstChild); |
+ checkImagesLoaded(); |
+ }); |
+ } |
+ </script> |
</app> |