Remove flights example
Flights is not longer a good example of something you can build wity Sky. Restore the flights-app-pixel test and move the assets needed for the test into the tests directory. R=ojan@chromium.org Review URL: https://codereview.chromium.org/1034953003
@ -1,28 +0,0 @@
|
||||
<sky>
|
||||
<import src="/sky/benchmarks/resources/runner.sky" as="PerfRunner" />
|
||||
<import src="/sky/examples/city-list/city-list.sky" as="citylist" />
|
||||
<script>
|
||||
var sky = document.querySelector("sky");
|
||||
var element;
|
||||
|
||||
var CityListElement = citylist.CityListElement;
|
||||
|
||||
var runner = new PerfRunner({
|
||||
setup: function() {
|
||||
// Don't benchmark removal.
|
||||
if (element)
|
||||
element.remove();
|
||||
},
|
||||
iterations: 10,
|
||||
unit: "ms",
|
||||
});
|
||||
|
||||
runner.runAsync(function(done) {
|
||||
element = new CityListElement();
|
||||
sky.appendChild(element);
|
||||
element.addEventListener('load', function() {
|
||||
done();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</sky>
|
||||
@ -1,24 +0,0 @@
|
||||
<sky>
|
||||
<import src="/sky/benchmarks/resources/runner.sky" as="PerfRunner" />
|
||||
<import src="/sky/examples/flights-app/flights-app.sky" as="FlightsAppElement" />
|
||||
<script>
|
||||
var sky = document.querySelector("sky");
|
||||
var element;
|
||||
|
||||
var runner = new PerfRunner({
|
||||
setup: function() {
|
||||
// Don't benchmark removal.
|
||||
if (element)
|
||||
element.remove();
|
||||
},
|
||||
iterations: 10,
|
||||
unit: "ms",
|
||||
});
|
||||
|
||||
runner.runAsync(function(done) {
|
||||
element = new FlightsAppElement();
|
||||
sky.appendChild(element);
|
||||
done();
|
||||
});
|
||||
</script>
|
||||
</sky>
|
||||
18
tests/framework/flights-app-pixels-expected.sky
Normal file
@ -0,0 +1,18 @@
|
||||
<sky>
|
||||
<import src="../resources/run-after-display.sky"/>
|
||||
|
||||
<img src="http://storage.googleapis.com/mojo/sky-pngs/a4dc155c6a26016292a09dfc7271d871c1780e30" />
|
||||
|
||||
<script>
|
||||
import "dart:sky";
|
||||
import "dart:sky.internals" as internals;
|
||||
|
||||
void main() {
|
||||
window.addEventListener("load", (_) {
|
||||
runAfterDisplay(() {
|
||||
internals.notifyTestComplete("");
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</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>
|
||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 640 B After Width: | Height: | Size: 640 B |
|
Before Width: | Height: | Size: 117 B After Width: | Height: | Size: 117 B |
|
Before Width: | Height: | Size: 112 B After Width: | Height: | Size: 112 B |
|
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 135 B |
|
Before Width: | Height: | Size: 121 B After Width: | Height: | Size: 121 B |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |