Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/cache/test/mochitest/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 2 kB image not shown  

Quelle  test_cache_restart.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/cache/test/mochitest/test_cache_restart.html


<!-- Any copyright is dedicated to the Public Domain.
   - http://creativecommons.org/publicdomain/zero/1.0/ -->

<!DOCTYPE HTML>
<html>
<head>
  <title>Test Cache with QuotaManager Restart</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<script class="testbody" type="text/javascript">
function setupTestIframe() {
  return new Promise(function(resolve) {
    var iframe = document.createElement("iframe");
    iframe.src = "empty.html";
    iframe.onload = function() {
      window.caches = iframe.contentWindow.caches;
      resolve();
    };
    document.body.appendChild(iframe);
  });
}

function resetStorage() {
  return new Promise(function(resolve) {
    var qms = SpecialPowers.Services.qms;
    var principal = SpecialPowers.wrap(document).nodePrincipal;
    var request = qms.resetStoragesForPrincipal(principal);
    var cb = SpecialPowers.wrapCallback(resolve);
    request.callback = cb;
  });
}

SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({
  "set": [["dom.caches.testing.enabled", true],
          ["dom.quotaManager.testing", true]],
}, function() {
  var name = "foo";
  var url = "./test_cache_add.js";
  var cache;
  setupTestIframe().then(function() {
    return caches.open(name);
  }).then(function(c) {
    cache = c;
    return cache.add(url);
  }).then(function() {
    return resetStorage();
  }).then(function() {
    return cache.match(url).then(function() {
      ok(false, "old cache reference should not work after reset");
    }).catch(function() {
      ok(true, "old cache reference should not work after reset");
    });
  }).then(function() {
    return caches.open(name);
  }).then(function(c) {
    cache = c;
    return cache.match(url);
  }).then(function(resp) {
    ok(!!resp, "cache should work after QM reset");
    return caches.delete(name);
  }).then(function(success) {
    ok(success, "cache should be deleted");
    SimpleTest.finish();
  });
});
</script>
</body>
</html>

Messung V0.5
C=95 H=92 G=93

¤ Dauer der Verarbeitung: 0.25 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.