Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  frameQuota.html   Sprache: HTML

 
 products/sources/formale Sprachen/C/Firefox/dom/tests/mochitest/localstorage/frameQuota.html


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>slave for sessionStorage test</title>

<script type="text/javascript" src="interOriginFrame.js"></script>
<script type="text/javascript">

const DOM_QUOTA_EXCEEDED_ERR = 0x80530016;

function checkException(func, exc)
{
  var exceptionThrew = false;
  try {
    func();
  }
  catch (ex) {
    exceptionThrew = true;
    is(ex.result, exc, "Expected "+exc+" exception");
  }
  ok(exceptionThrew, "Exception "+exc+" threw at "+location);
}

function doStep()
{
  var query = location.search.substring(1);
  var queries = query.split("&");

  var operation = queries[0];
  var keyName = queries[1];
  var result = queries[2];

  switch (result)
  {
    case "success":
      switch (operation)
      {
        case "add":
          // Store 500 bytes long string must succeed
          localStorage.setItem(keyName, "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890");
          is(localStorage.getItem(keyName), "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890""500 bytes key "+keyName+" stored");
          break;

        case "remove":
          localStorage.removeItem(keyName);
          is(localStorage.getItem(keyName), null, "Key "+keyName+" removed");
          break;
      }

      break;

    case "failure":
      switch (operation)
      {
        case "add":
          // Attempt to store 500 bytes long string that doens't
          // fit the quota, have to throw DOM_QUOTA_EXCEEDED_ERR exception
          checkException(function() {
            localStorage.setItem(keyName, "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890");
          }, DOM_QUOTA_EXCEEDED_ERR);
          is(localStorage.getItem(keyName), null, "500 bytes key "+keyName+" is NOT stored");
          break;

        case "add2":
          // Attempt to change a key value to reach the DOM quota and
          // check it fails and the old key value is still present.
          checkException(function() {
            localStorage.setItem(keyName, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890");
          }, DOM_QUOTA_EXCEEDED_ERR);
          is(localStorage.getItem(keyName), "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890""Key "+keyName+" left unchanged");
          break;
      }

      break;

    default:
      switch (operation)
      {
        case "clear":
          localStorage.clear();
          break;
      }

      break;
  }

  // Just inform the master we are finished now
  postMsg("done");
  return false;
}

</script>

</head>

<body onload="postMsg('frame loaded');">
</body>
</html>

Messung V0.5
C=100 H=100 G=100

¤ Dauer der Verarbeitung: 0.1 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge