chromium/third_party/blink/web_tests/svg/custom/baseval-animval-equality.svg

<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" id="svg" width="600" height="400">
  <foreignObject width="100%" height="100%">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <div id="log">
        This tests to make sure that baseVal and animVal are tied when animation is not enabled:
      </div>
    </html>
  </foreignObject>
  <script type="text/javascript">
  <![CDATA[
    if (window.testRunner)
        testRunner.dumpAsText();

    function log(message) {
        var logDiv = document.getElementById('log');
        var newDiv = document.createElementNS("http://www.w3.org/1999/xhtml",'div');
        newDiv.appendChild(document.createTextNode(message));
        logDiv.appendChild(newDiv);
    }
    var svg = document.getElementById('svg');
    if (svg.x && svg.x.baseVal && svg.x.animVal) {
      log("svg.x.baseVal.value = " + svg.x.baseVal.value);
      log("svg.x.animVal.value = " + svg.x.animVal.value);
      log("setting svg.x.baseVal.value = 10");
      svg.x.baseVal.value = 10;
      log("svg.x.baseVal.value = " + svg.x.baseVal.value);
      log("svg.x.animVal.value = " + svg.x.animVal.value);
      if ((svg.x.baseVal.value == svg.x.animVal.value) && (svg.x.animVal.value == 10))
        log("SUCCESS (1 of 2)");
      else
        log("FAILED");
      log("setting svg.x.animVal.value = 5");
      try {
        svg.x.animVal.value = 5;
      } catch(e) {
        log("caught exception: " + e.message);
      }
      log("svg.x.baseVal.value = " + svg.x.baseVal.value);
      log("svg.x.animVal.value = " + svg.x.animVal.value);
      if ((svg.x.baseVal.value == svg.x.animVal.value) && (svg.x.animVal.value == 10))
        log("SUCCESS (2 of 2)");
      else
        log("FAILED");
    } else {
      log("FAILED, svg.x, svg.x.baseVal or svg.x.animVal undefined.")
    }
  ]]>
  </script>
</svg>