dom/smil/test/test_smilMappedAttrFromTo.xhtml

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/smil/test/test_smilMappedAttrFromTo.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,83 @@
     1.4 +<html xmlns="http://www.w3.org/1999/xhtml">
     1.5 +<head>
     1.6 +  <title>Test for Animation Behavior on CSS Properties</title>
     1.7 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     1.8 +  <script type="text/javascript" src="smilTestUtils.js"></script>
     1.9 +  <script type="text/javascript" src="db_smilMappedAttrList.js"></script>
    1.10 +  <script type="text/javascript" src="db_smilCSSPropertyList.js"></script>
    1.11 +  <script type="text/javascript" src="db_smilCSSFromTo.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.13 +</head>
    1.14 +<body>
    1.15 +<p id="display"></p>
    1.16 +<div id="content">
    1.17 +<svg xmlns="http://www.w3.org/2000/svg"
    1.18 +     width="200px" height="200px" font-size="50px" style="color: rgb(50,50,50)"
    1.19 +     onload="this.pauseAnimations()">
    1.20 +  <rect x="20" y="20" width="200" height="200"/>
    1.21 +  <!-- NOTE: hard-wiring 'line-height' so that computed value of 'font' is
    1.22 +       more predictable. (otherwise, line-height varies depending on platform)
    1.23 +    -->
    1.24 +  <text x="20" y="20">testing 123</text>
    1.25 +  <line/>
    1.26 +  <image/>
    1.27 +  <marker/>
    1.28 +  <clipPath><circle/></clipPath>
    1.29 +  <filter><feFlood/></filter>
    1.30 +  <filter><feDiffuseLighting/></filter>
    1.31 +  <linearGradient><stop/></linearGradient>
    1.32 +</svg>
    1.33 +</div>
    1.34 +<pre id="test">
    1.35 +<script class="testbody" type="text/javascript">
    1.36 +<![CDATA[
    1.37 +
    1.38 +SimpleTest.waitForExplicitFinish();
    1.39 +
    1.40 +function checkForUntestedAttributes(bundleList)
    1.41 +{
    1.42 +  // Create the set of all the attributes we know about
    1.43 +  var attributeSet = {};
    1.44 +  for (attributeLabel in gMappedAttrList) {
    1.45 +    // insert attribute
    1.46 +    attributeSet[gMappedAttrList[attributeLabel].attrName] = null;
    1.47 +  }
    1.48 +  // Remove tested properties from the set
    1.49 +  for (var bundleIdx in bundleList) {
    1.50 +    var bundle = bundleList[bundleIdx];
    1.51 +    delete attributeSet[bundle.animatedAttribute.attrName];
    1.52 +  }
    1.53 +  // Warn about remaining (untested) properties
    1.54 +  for (var untestedProp in attributeSet) {
    1.55 +    ok(false, "No tests for attribute '" + untestedProp + "'");
    1.56 +  }
    1.57 +}
    1.58 +
    1.59 +function main()
    1.60 +{
    1.61 +  // Start out with document paused
    1.62 +  var svg = SMILUtil.getSVGRoot();
    1.63 +  ok(svg.animationsPaused(), "should be paused by <svg> load handler");
    1.64 +  is(svg.getCurrentTime(), 0, "should be paused at 0 in <svg> load handler");
    1.65 +
    1.66 +  var testBundles = convertCSSBundlesToMappedAttr(gFromToBundles);
    1.67 +
    1.68 +  // FIRST: Warn about any attributes that are missing tests
    1.69 +  checkForUntestedAttributes(testBundles);
    1.70 +
    1.71 +  // Run the actual tests
    1.72 +  testBundleList(testBundles, new SMILTimingData(1.0, 1.0));
    1.73 +
    1.74 +  // Set "display:none" on everything and run the tests again
    1.75 +  SMILUtil.hideSubtree(SMILUtil.getSVGRoot(), false, true);
    1.76 +  testBundleList(testBundles, new SMILTimingData(1.0, 1.0));
    1.77 +
    1.78 +  SimpleTest.finish();
    1.79 +}
    1.80 +
    1.81 +window.addEventListener("load", main, false);
    1.82 +]]>
    1.83 +</script>
    1.84 +</pre>
    1.85 +</body>
    1.86 +</html>

mercurial