Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument.html

Issue 2015623004: Import wpt@ed94c51f3dfaa5ff4c9c311add1a560408059c51 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>KeyframeEffectReadOnly constructor tests</title>
4 <link rel="help" href="https://w3c.github.io/web-animations/#processing-a-keyfra mes-argument">
5 <script src="../../../../../resources/testharness.js"></script>
6 <script src="../../../../../resources/testharnessreport.js"></script>
7 <script src="../../testcommon.js"></script>
8 <body>
9 <div id="log"></div>
10 <div id="target"></div>
11 <script>
12 'use strict';
13
14 // Test the "process a keyframe-like object" procedure.
15 //
16 // This file only tests the KeyframeEffectReadOnly constructor since it is
17 // assumed that the implementation of the KeyframeEffect constructor,
18 // Animatable.animate() method, and KeyframeEffect.setKeyframes() method will
19 // all share common machinery and it is not necessary to test each method.
20
21 // Test that only animatable properties are accessed
22
23 var gNonAnimatableProps = [
24 'animation', // Shorthands where all the longhand sub-properties are not
25 // animatable, are also not animatable.
26 'animationDelay',
27 'animationDirection',
28 'animationDuration',
29 'animationFillMode',
30 'animationIterationCount',
31 'animationName',
32 'animationPlayState',
33 'animationTimingFunction',
34 'transition',
35 'transitionDelay',
36 'transitionDuration',
37 'transitionProperty',
38 'transitionTimingFunction',
39 'display',
40 'unsupportedProperty',
41 ];
42
43 function TestKeyframe(testProp) {
44 var _propAccessCount = 0;
45
46 Object.defineProperty(this, testProp, {
47 get: function() { _propAccessCount++; },
48 enumerable: true
49 });
50
51 Object.defineProperty(this, 'propAccessCount', {
52 get: function() { return _propAccessCount; }
53 });
54 }
55
56 function GetTestKeyframeSequence(testProp) {
57 return [ new TestKeyframe(testProp) ]
58 }
59
60 gNonAnimatableProps.forEach(function(prop) {
61 test(function(t) {
62 var testKeyframe = new TestKeyframe(prop);
63
64 new KeyframeEffectReadOnly(null, testKeyframe);
65
66 assert_equals(testKeyframe.propAccessCount, 0, 'Accessor not called');
67 }, 'non-animatable property \'' + prop + '\' is not accessed when using'
68 + ' a property-indexed keyframe object');
69 });
70
71 gNonAnimatableProps.forEach(function(prop) {
72 test(function(t) {
73 var testKeyframes = GetTestKeyframeSequence(prop);
74
75 new KeyframeEffectReadOnly(null, testKeyframes);
76
77 assert_equals(testKeyframes[0].propAccessCount, 0, 'Accessor not called');
78 }, 'non-animatable property \'' + prop + '\' is not accessed when using'
79 + ' a keyframe sequence');
80 });
81
82 // FIXME: Test that non-enumerable properties are not accessed
83
84 // FIXME: Test that properties are accessed in ascending order by Unicode
85 // codepoint
86 // (There is an existing test for this in
87 // keyframe-effect/constructor.html that should be moved here.)
88
89 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698