| <!DOCTYPE HTML> |
| <html manifest="testdata/with_fallback.appcache"> |
| <head> |
| <meta charset="utf-8"> |
| <title>HTML5 application cache test with manifest</title> |
| <link rel="stylesheet" href="/filez/_main/third_party/js/qunit/qunit.css"> |
| <script src="/filez/_main/third_party/js/qunit/qunit.js"></script> |
| <script src="/filez/_main/third_party/js/qunit/qunit_test_runner.js"></script> |
| <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.userAgent.product'); |
| </script> |
| |
| <script type="text/javascript"> |
| // WebDriver does not enable application cache for Android-Froyo (b/5478400). |
| var APPCACHE_NOT_WORKING = |
| !bot.html5.isSupported(bot.html5.API.APPCACHE) || |
| goog.userAgent.product.ANDROID; |
| |
| var isCached = false; |
| if (!APPCACHE_NOT_WORKING) { |
| goog.events.listenOnce(window.applicationCache, 'cached', function(e) { |
| isCached = true; |
| }); |
| } |
| |
| QUnit.test('getStatusWithHtmlManifest', function(assert) { |
| if (APPCACHE_NOT_WORKING) { |
| assert.ok(true, 'Skipping: appcache not working'); |
| return; |
| } |
| |
| // On most browsers, the app is cached by now. This check should not be |
| // made asynch because one cannot reliably detect the cached event. |
| if (isCached) { |
| assert.strictEqual(bot.appcache.getStatus(window), |
| window.applicationCache.IDLE); |
| } else { |
| assert.ok(true, 'App not yet cached'); |
| } |
| }); |
| </script> |
| </head> |
| <body> |
| <div id="qunit"></div> |
| <div id="qunit-fixture"></div> |
| </body> |
| </html> |