"Fossies" - the Fresh Open Source Software Archive

Member "selenium-selenium-4.8.1/javascript/atoms/test/html5/appcache_test.html" (17 Feb 2023, 1311 Bytes) of package /linux/www/selenium-selenium-4.8.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <!DOCTYPE HTML>
    2 <html manifest="testdata/with_fallback.appcache">
    3 <head>
    4   <title>HTML5 application cache test with manifest</title>
    5   <script type="text/javascript" src="../test_bootstrap.js"></script>
    6   <script type="text/javascript">
    7     goog.require('bot.appcache');
    8     goog.require('bot.html5');
    9     goog.require('bot.test');
   10     goog.require('goog.events');
   11     goog.require('goog.testing.jsunit');
   12     goog.require('goog.userAgent.product');
   13   </script>
   14 
   15   <script type="text/javascript">
   16     // WebDriver does not enable application cache for Android-Froyo (b/5478400).
   17     var APPCACHE_NOT_WORKING =
   18       !bot.html5.isSupported(bot.html5.API.APPCACHE) ||
   19       goog.userAgent.product.ANDROID;
   20 
   21     var isCached = false;
   22     if (!APPCACHE_NOT_WORKING) {
   23       goog.events.listenOnce(window.applicationCache, 'cached', function(e) {
   24         isCached = true;
   25       });
   26     }
   27 
   28     function testGetStatusWithHtmlManifest() {
   29       if (APPCACHE_NOT_WORKING) {
   30         return;
   31       }
   32 
   33       // On most browsers, the app is cached by now. This check should not be
   34       // made asynch because one cannot reliably detect the cached event.
   35       if (isCached) {
   36         assertEquals(window.applicationCache.IDLE,
   37                      bot.appcache.getStatus(window));
   38       }
   39     }
   40   </script>
   41 </head>
   42 </html>