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


Quelle  test_smilInvalidValues.html   Sprache: HTML

 
 products/sources/formale Sprachen/C/Firefox/dom/smil/test/test_smilInvalidValues.html


<!doctype html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=941315
-->

<head>
  <meta charset="utf-8">
  <title>Test invalid values cause the model to be updated (bug 941315)</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=941315">Mozilla Bug 941315</a>
<p id="display"></p>
<div id="content" style="display: none">
<svg width="100%" height="1" onload="this.pauseAnimations()">
  <rect>
    <animate id="a" dur="100s"/>
    <animate id="b" dur="5s" begin="a.end"/>
  </rect>
  <circle cx="-100" cy="20" r="15" fill="blue" id="circle"/>
</svg>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
  var a = $('a'),
      b = $('b');

  // Animation doesn't start until onload
  SimpleTest.waitForExplicitFinish();
  window.addEventListener("load", runTests);

  // Make testing getStartTime easier
  SVGAnimationElement.prototype.safeGetStartTime = function() {
    try {
      return this.getStartTime();
    } catch(e) {
      if (e.name == "InvalidStateError" &&
          e.code == DOMException.INVALID_STATE_ERR) {
        return 'none';
      } else {
        ok(false, "Unexpected exception: " + e);
        return null;
      }
    }
  };

  function runTests() {
    [testSimpleDuration, testSimpleDuration2, testMin, testMax, testRepeatDur, testRepeatCount]
      .forEach(function(test) {
        is(b.getStartTime(), 100, "initial state before running " + test.name);
        test();
        is(b.getStartTime(), 100, "final state after running " + test.name);
      });
    SimpleTest.finish();
  }

  function testSimpleDuration() {
    // Verify a valid value updates as expected
    a.setAttribute("dur""50s");
    is(b.safeGetStartTime(), 50, "valid simple duration");

    // Check an invalid value also causes the model to be updated
    a.setAttribute("dur""abc"); // -> indefinite
    is(b.safeGetStartTime(), "none""invalid simple duration");

    // Restore state
    a.setAttribute("dur""100s");
  }

  function testSimpleDuration2() {
    // Check an invalid value causes the model to be updated
    a.setAttribute("dur""-.1s"); // -> indefinite
    is(b.safeGetStartTime(), "none""invalid simple duration");

    // Restore state
    a.setAttribute("dur""100s");
  }

  function testMin() {
    a.setAttribute("min""200s");
    is(b.safeGetStartTime(), 200, "valid min duration");

    a.setAttribute("min""abc"); // -> indefinite
    is(b.safeGetStartTime(), 100, "invalid min duration");

    a.removeAttribute("min");
  }

  function testMax() {
    a.setAttribute("max""50s");
    is(b.safeGetStartTime(), 50, "valid max duration");

    a.setAttribute("max""abc"); // -> indefinite
    is(b.safeGetStartTime(), 100, "invalid max duration");

    a.removeAttribute("max");
  }

  function testRepeatDur() {
    a.setAttribute("repeatDur""200s");
    is(b.safeGetStartTime(), 200, "valid repeatDur duration");

    a.setAttribute("repeatDur""abc"); // -> indefinite
    is(b.safeGetStartTime(), 100, "invalid repeatDur duration");

    a.removeAttribute("repeatDur");
  }

  function testRepeatCount() {
    a.setAttribute("repeatCount""2");
    is(b.safeGetStartTime(), 200, "valid repeatCount duration");

    a.setAttribute("repeatCount""abc"); // -> indefinite
    is(b.safeGetStartTime(), 100, "invalid repeatCount duration");

    a.removeAttribute("repeatCount");
  }
</script>
</pre>
</body>
</html>

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

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