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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/animation/CompositorAnimations.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/virtual/threaded/animations/compositor-independent-transform-properties.html
diff --git a/LayoutTests/virtual/threaded/animations/compositor-independent-transform-properties.html b/LayoutTests/virtual/threaded/animations/compositor-independent-transform-properties.html
new file mode 100644
index 0000000000000000000000000000000000000000..be29576003b50941f272bc27dff13acc11556f60
--- /dev/null
+++ b/LayoutTests/virtual/threaded/animations/compositor-independent-transform-properties.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+
+<div id="parent"></div>
+
+<script>
+function assertComposited(properties, isComposited) {
+ var element = document.createElement('div');
+ document.getElementById('parent').appendChild(element);
+
+ var properties = typeof properties == "string" ? [properties] : properties;
+ var obj = {};
alancutter (OOO until 2018) 2015/07/02 04:44:47 s/obj/keyframe/
+
+ properties.forEach(function(property) {
+ obj[property] = 'initial';
alancutter (OOO until 2018) 2015/07/02 04:44:47 Nice.
+ });
+
+ var animation = element.animate([obj, obj], {
+ duration: 4000,
+ iterations: Infinity
+ });
+
+ var asyncHandle = async_test("Compositor Test with " + properties);
+ requestAnimationFrame(function() {
+ requestAnimationFrame(function() {
+
+ assert_equals(internals.isCompositedAnimation(animation), isComposited, properties + (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
+
+ animation.cancel();
+ asyncHandle.done();
+ });
+ });
+}
+
+var assertIsComposited = function(properties) { return assertComposited(properties, true); }
+var assertIsNotComposited = function(properties) { return assertComposited(properties, false); }
+
+assertIsComposited('transform');
+assertIsComposited('opacity');
+
+assertIsComposited('translate');
+assertIsComposited('rotate');
+assertIsComposited('scale');
+
+assertIsComposited(['transform', 'opacity']);
+assertIsComposited(['translate', 'opacity']);
+assertIsComposited(['rotate', 'opacity']);
+assertIsComposited(['scale', 'opacity']);
+
+assertIsNotComposited(['transform', 'translate']);
+assertIsNotComposited(['transform', 'scale']);
+assertIsNotComposited(['transform', 'rotate']);
+
+assertIsNotComposited(['translate', 'scale']);
+assertIsNotComposited(['translate', 'rotate']);
+assertIsNotComposited(['rotate', 'scale']);
+
+assertIsNotComposited(['translate', 'rotate', 'scale']);
+assertIsNotComposited(['transform', 'translate', 'rotate', 'scale']);
+</script>
« 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