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

Unified Diff: LayoutTests/virtual/threaded/animations/compositor-transform-with-scale.html

Issue 1218943002: Compositor animations for Independent CSS Transform Properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanup 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
Index: LayoutTests/virtual/threaded/animations/compositor-transform-with-scale.html
diff --git a/LayoutTests/virtual/threaded/animations/compositor-transform-with-scale.html b/LayoutTests/virtual/threaded/animations/compositor-transform-with-scale.html
new file mode 100644
index 0000000000000000000000000000000000000000..0e2bf0bd0543133b5284c8e702742922518c8294
--- /dev/null
+++ b/LayoutTests/virtual/threaded/animations/compositor-transform-with-scale.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<style>
+.box {
+ height: 100px;
+ width: 100px;
+}
+
+#transformOnly {
+ background-color: blue;
+}
+
+#scaleOnly {
+ background-color: red;
+}
+
+#mixed {
+ background-color: purple;
+}
+</style>
+<div id="human">
+ <p>Tests that composited animation happens when only transform or only scale is present.</p>
+</div>
+<div id="transformOnly" class="box">Transform Only</div>
+<div id="scaleOnly" class="box">Scale Only</div>
+<div id="mixed" class="box">Transform + Scale</div>
+<script>
+var transformOnlyAnimation = transformOnly.animate([
+ {transform: 'scale(1, 1)'},
+ {transform: 'scale(4, 4)'}
+], {
+ duration: 4000,
+ iterations: Infinity
+});
+
+var scaleOnlyAnimation = scaleOnly.animate([
+ {scale: '1 1'},
+ {scale: '4 4'}
+], {
+ duration: 4000,
+ iterations: Infinity
+});
+
+var mixedAnimation = mixed.animate([
+ {transform: 'scale(1, 1)', scale: '1 1'},
+ {transform: 'scale(2, 2)', scale: '2 2'}
+], {
+ duration: 4000,
+ iterations: Infinity
+});
+
+if (window.testRunner) {
+ [].forEach.call(document.querySelectorAll('#human,.box'), function(element) {
+ element.textContent = '';
+ })
+}
+
+var asyncHandle = async_test("Compositor Test with Scale");
+requestAnimationFrame(function() {
+ requestAnimationFrame(function() {
+ assert_true(internals.isCompositedAnimation(transformOnlyAnimation), 'Only Transform should be composited');
+ assert_true(internals.isCompositedAnimation(scaleOnlyAnimation), 'Only Scale should be composited');
+ assert_false(internals.isCompositedAnimation(mixedAnimation), 'Mixed should not be composited');
+ asyncHandle.done();
+ });
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698