Skip to content

Commit

Permalink
Change test to always remove the image element but load the assets pl…
Browse files Browse the repository at this point in the history
…ugin conditionally.
  • Loading branch information
tvandervossen authored and madrobby committed Oct 25, 2010
1 parent e63dc49 commit e9b26b6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/assets_functional.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<title>Zepto assets functional test</title>
<meta name="viewport" content="maximum-scale=1,initial-scale=1,user-scalable=0" />
<script src="../src/zepto.js"></script>
<script src="../src/assets.js"></script>
<style>
#container div {
margin: 2px;
Expand All @@ -23,30 +22,33 @@
<h1>Zepto assets functional test</h1>

<ul>
<li><a href="?without">Run without remove</a></li>
<li><a href="?remove">Run with remove</a></li>
<li><a href="?without">Run without the assets plugin</a></li>
<li><a href="?with">Run with the assets plugin</a></li>
<li><a href="?">Stop</a></li>
</ul>

<p>When running 'without remove' Mobile Safari will stop loading after on average 8 images (that's on the iPad with 1 MB images). It might also crash.</p>
<p>When you run this test withour the assets plugin, Mobile Safari will stop loading after on average 8 images (that's on the iPad with 1 MB images). It might also crash.</p>
<p><strong>PLEASE NOTE:</strong> You <strong>must restart Safari</strong> between runs (click the home button to return to the home screen, double-click the home button, tap-and-hold the Safari icon, then tap the minus badge).</p>

<div id="container"></div>

<script>
<!--
var prefix = 'http://stuff.vandervossen.net/temporary/zepto_assets_test/sintel-';
var mode = window.location.search.slice(1);
var timeout;
if (mode === 'with') {
document.write('<script src="../src/assets.js"></script>');
}
if (mode !== '') {
var i = 1;
(function frame() {
if (mode === 'remove') {
$('#image' + (i - 4)).remove();
}
$('#image' + (i - 4)).remove();
$('#container').prepend('<div>' + i + ': <img id="image' + i + '" src="' + prefix + i + '.jpg"></div>');
if (i++ < 51) timeout = setTimeout(frame, 6000);
})();
}
-->
</script>
</body>
</html>

0 comments on commit e9b26b6

Please sign in to comment.