chromium/third_party/blink/web_tests/animations/cross-fade-webkit-mask-box-image.html

<html>
<head>
  <style>
    #box {
        position: absolute;
        left: 100px;
        top: 100px;
        height: 200px;
        width: 200px;
        background-color: red;
        animation: anim 1s linear infinite;
    }
    #boxStatic {
        position: absolute;
        left: 100px;
        top: 300px;
        height: 200px;
        width: 200px;
        background-color: red;
        -webkit-mask-box-image: cross-fade(75% url(resources/stripes-100.png), url(resources/green-100.png)) 50 stretch;
    }
    @keyframes anim {
        from { -webkit-mask-box-image: url(resources/stripes-100.png) 50 stretch; }
        to   { -webkit-mask-box-image: url(resources/green-100.png) 50 stretch; }
    }
  </style>
  <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript" charset="utf-8">
  // This test was flaky because it would start before the images were loaded.
  var imagesLoaded = 0;
  function imageLoaded() {
    ++imagesLoaded;
    if (imagesLoaded == 2) {
      const expectedValues = [
        // [time, element-id, property, expected-value, tolerance]
        [2.25, ["box", "boxStatic"], "webkitMaskBoxImage", 0.25, 0.05]
      ];
      var doPixelTest = true;
      var disablePauseAPI = false;
      var startTestImmediately = true;
      runAnimationTest(expectedValues, undefined, undefined, disablePauseAPI, doPixelTest, startTestImmediately);
    }
  }
  </script>
</head>
<body>
<img id="box" src="resources/green-100.png" onLoad="imageLoaded();"/>
<img id="boxStatic" src="resources/stripes-100.png" onLoad="imageLoaded();"/>
<div id="result"></div>
</body>
</html>