summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/web-animations-api/change-in-animation-frame.html
blob: 9da95d94bfd531d13e91b74e412db7f398eb9167 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<div id="pass" style="visibility: hidden">PASS</div>
<div id="fail" style="visibility: visible">FAIL</div>
<script>
requestAnimationFrame(function() {
  document.getElementById('pass').animate([{visibility: 'visible'}, {visibility: 'visible'}], 10);
  document.getElementById('fail').animate([{visibility: 'hidden'}, {visibility: 'hidden'}], 10);
  requestAnimationFrame(function() {
    document.documentElement.textContent = 'FAIL: Produced a second frame.';
  });
});
if (window.testRunner) {
  testRunner.dumpAsText();
  testRunner.waitUntilDone();
  setTimeout(function() {
    if (window.testRunner) {
      // Note that the test wont actually finish until the next frame is complete.
      testRunner.notifyDone();
    }
  }, 0);
} else {
  document.documentElement.textContent = 'FAIL: Test must be run under test harness.';
}
</script>