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

Side by Side Diff: LayoutTests/virtual/threaded/animations/compositor-independent-transform-properties.html

Issue 1218943002: Compositor animations for Independent CSS Transform Properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Improve tests Created 5 years, 5 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
« no previous file with comments | « no previous file | Source/core/animation/CompositorAnimations.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4
5 <div id="parent"></div>
6
7 <script>
8 function assertComposited(properties, isComposited) {
9 var element = document.createElement('div');
10 document.getElementById('parent').appendChild(element);
11
12 var properties = typeof properties == "string" ? [properties] : properties;
13 var obj = {};
alancutter (OOO until 2018) 2015/07/02 04:44:47 s/obj/keyframe/
14
15 properties.forEach(function(property) {
16 obj[property] = 'initial';
alancutter (OOO until 2018) 2015/07/02 04:44:47 Nice.
17 });
18
19 var animation = element.animate([obj, obj], {
20 duration: 4000,
21 iterations: Infinity
22 });
23
24 var asyncHandle = async_test("Compositor Test with " + properties);
25 requestAnimationFrame(function() {
26 requestAnimationFrame(function() {
27
28 assert_equals(internals.isCompositedAnimation(animation), isComposited, pr operties + (isComposited ? " should " : " should not ") + "be composited");
alancutter (OOO until 2018) 2015/07/02 04:44:47 You need to wrap this in asyncHandle.step(function
29
30 animation.cancel();
31 asyncHandle.done();
32 });
33 });
34 }
35
36 var assertIsComposited = function(properties) { return assertComposited(properti es, true); }
37 var assertIsNotComposited = function(properties) { return assertComposited(prope rties, false); }
38
39 assertIsComposited('transform');
40 assertIsComposited('opacity');
41
42 assertIsComposited('translate');
43 assertIsComposited('rotate');
44 assertIsComposited('scale');
45
46 assertIsComposited(['transform', 'opacity']);
47 assertIsComposited(['translate', 'opacity']);
48 assertIsComposited(['rotate', 'opacity']);
49 assertIsComposited(['scale', 'opacity']);
50
51 assertIsNotComposited(['transform', 'translate']);
52 assertIsNotComposited(['transform', 'scale']);
53 assertIsNotComposited(['transform', 'rotate']);
54
55 assertIsNotComposited(['translate', 'scale']);
56 assertIsNotComposited(['translate', 'rotate']);
57 assertIsNotComposited(['rotate', 'scale']);
58
59 assertIsNotComposited(['translate', 'rotate', 'scale']);
60 assertIsNotComposited(['transform', 'translate', 'rotate', 'scale']);
61 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/CompositorAnimations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698