blob: 768f7917f711668e98c1d839e1d7e7da89b675d7 [file] [log] [blame]
<!DOCTYPE HTML>
<html manifest="testdata/with_fallback.appcache">
<head>
<title>HTML5 application cache test with manifest</title>
<script type="text/javascript" src="../test_bootstrap.js"></script>
<script type="text/javascript">
goog.require('bot.appcache');
goog.require('bot.html5');
goog.require('bot.test');
goog.require('goog.events');
goog.require('goog.testing.jsunit');
goog.require('goog.testing.AsyncTestCase');
goog.require('goog.userAgent');
goog.require('goog.userAgent.product');
</script>
<script type="text/javascript">
var asyncTestCase = null;
// WebDriver does not enable application cache for Android-Froyo (b/5478400).
// WebDriver does not enable application cache for Firefox (b/5787180).
// Selenium breaks application cache on Opera (b/578165).
var APPCACHE_NOT_WORKING =
!bot.html5.isSupported(bot.html5.API.APPCACHE) ||
goog.userAgent.product.ANDROID ||
goog.userAgent.product.FIREFOX ||
(goog.userAgent.OPERA && bot.test.isSeleniumBacked());
function testGetStatusWithHtmlManifest() {
if (APPCACHE_NOT_WORKING) {
return;
}
var win = bot.getWindow();
if (win.applicationCache.IDLE != bot.appcache.getStatus()) {
asyncTestCase.waitForAsync('waiting for cache to be downloaded.');
goog.events.listenOnce(win.applicationCache, 'cached', function(e) {
asyncTestCase.continueTesting();
assertEquals(win.applicationCache.IDLE, bot.appcache.getStatus());
});
}
}
</script>
</head>
<body>
<script>
asyncTestCase = goog.testing.AsyncTestCase.createAndInstall();
</script>
Test
<img id="red" src="testdata/ps_logo2.png">
</body>
</html>