Skip to content

Commit

Permalink
for functional tests, show the userAgent to make it easier to compare…
Browse files Browse the repository at this point in the history
… cross-platform/version results
  • Loading branch information
madrobby committed Nov 27, 2011
1 parent 4da02ac commit 6a110b7
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
6 changes: 5 additions & 1 deletion test/assets_functional.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
</head>
<body>
<h1>Zepto assets functional test</h1>

<div id="browser"></div>

<ul>
<li><a href="?without">Run without the assets plugin</a></li>
Expand All @@ -33,7 +35,7 @@ <h1>Zepto assets functional test</h1>
<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-',
mode = window.location.search.slice(1),
Expand All @@ -51,6 +53,8 @@ <h1>Zepto assets functional test</h1>
if (i++ < 51) timeout = setTimeout(frame, 6000);
})();
}

$('#browser').text(navigator.userAgent);
</script>
</body>
</html>
6 changes: 6 additions & 0 deletions test/fx_functional.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,11 @@ <h1>Zepto fx functional</h1>
<button onclick="$('#fx_test').fadeIn('slow')">Fade in</button>
<button onclick="$('#fx_test').fadeOut('slow')">Fade out</button>
<button onclick="$('#fx_test').fadeToggle('slow')">Fade toggle</button>

<div id="browser"> </div>

<script>
$('#browser').text(navigator.userAgent);
</script>
</body>
</html>
4 changes: 4 additions & 0 deletions test/gesture_functional.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ <h1>Zepto gestures functional test</h1>
<div id="gesture_test" style="width: 200px; height: 200px; background: #ddd; -webkit-user-select: none">
gesture events test
</div>

<div id="browser"> </div>

<script>
$('#browser').text(navigator.userAgent);

$('#gesture_test')
.pinch(function(){
$(this).append(' | pinch!');
Expand Down
6 changes: 5 additions & 1 deletion test/touch_functional.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@
</head>
<body>
<h1>Zepto touch functional test</h1>

<div id="touch_test" style="width: 200px; height: 200px; background: #ddd; -webkit-user-select: none">
touch events test
</div>

<div id="browser"> </div>

<script>
$('#browser').text(navigator.userAgent);

$('body').bind('touchmove', function (e) {e.preventDefault();} );
$('#touch_test')
.tap(function(){
Expand Down
17 changes: 14 additions & 3 deletions test/touchcancel_functional.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,25 @@
</head>
<body>
<h1>Zepto touch functional test</h1>
<p>Double-tap and hold until the JavaScript alert occurs. After closing the
alert, tap again. Without touchcancel you will see a double tap instead of a tap.</p>

<p>
Double-tap and hold until the JavaScript alert occurs. After closing the
alert, tap again. Without touchcancel you will see a double tap instead of a tap.
</p>

<div id="touch_test" style="width: 200px; height: 200px; background: #ddd">
touch events test
</div>

<div id="browser"> </div>

<script>
setTimeout(function () {alert("Alert! Now tap again, you should see a tap!, not a double tap!");}, 3000);
$('#browser').text(navigator.userAgent);

setTimeout(function(){
alert("Alert! Now tap again, you should see a tap!, not a double tap!");
}, 3000);

$('body').bind('touchmove', function (e) {e.preventDefault();} );
$('#touch_test')
.tap(function(){
Expand Down

0 comments on commit 6a110b7

Please sign in to comment.