Home | History | Annotate | Download | only in blink
      1 <!doctype html>
      2 <title>Web Animations API: Insufficient Keyframe tests</title>
      3 <script src="testharness/testharness.js"></script>
      4 <script src="testharness/testharnessreport.js"></script>
      5 <div id='log'></div>
      6 <div id='div'></div>
      7 <script>
      8 
      9 test(function() {
     10   assert_throws({name: 'NotSupportedError'}, function() {
     11     div.animate([{width: '100px'}], 1);
     12   }, 'A keyframe list with a single keyframe should cause an exception.');
     13 },
     14 'single keyframe tests',
     15 {
     16   help:   'http://dev.w3.org/fxtf/web-animations/#the-unaccumulated-animation-value-of-a-keyframe-animation-effect',
     17   assert: 'Only keyframes with matched start and end properties are considered',
     18   author: 'Shane Stephens'
     19 });
     20 
     21 test(function() {
     22   assert_throws({name: 'NotSupportedError'}, function() {
     23     div.animate([{height: '100px'}, {width: '100px'}], 1);
     24   }, 'Mismatched start and end keyframes should cause an exception.');
     25 
     26   try {
     27     div.animate([{width: '100px'}, {height: '200px', offset: 0}, {width: '100px', offset: 1}, {height: '100px'}], 1);
     28   } catch (e) {
     29     assert_unreached("multiple start and end keyframes should be considered");
     30   }
     31 },
     32 'multiple keyframe tests',
     33 {
     34   help:   'http://dev.w3.org/fxtf/web-animations/#the-unaccumulated-animation-value-of-a-keyframe-animation-effect',
     35   assert: 'Only keyframes with matched start and end properties are considered',
     36   author: 'Shane Stephens'
     37 });
     38 
     39 </script>
     40