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

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: Add Manual Tests and fix bug with cancel 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 side-by-side diff with in-line comments
Download patch
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..3bd733315ec883179f7d910b326213f32c5448b2
--- /dev/null
+++ b/LayoutTests/virtual/threaded/animations/compositor-independent-transform-properties.html
@@ -0,0 +1,62 @@
+<!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 keyframe = {};
+
+ properties.forEach(function(property) {
+ keyframe[property] = 'initial';
+ });
+
+ var animation = element.animate([keyframe, keyframe], {
+ duration: 4000,
+ iterations: Infinity
+ });
+
+ var asyncHandle = async_test("Animation on " + properties.join(", ") + (isComposited ? " is " : " is not ") + "composited");
+ requestAnimationFrame(function() {
+ requestAnimationFrame(function() {
+ asyncHandle.step(function() {
+ assert_equals(internals.isCompositedAnimation(animation), isComposited, properties.join(", ") + (isComposited ? " should " : " should not ") + "be composited");
+ });
+
+ 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>

Powered by Google App Engine
This is Rietveld 408576698