Bug 1389429 - Part 1: Add a test for rotate3d with the non-nomalizable direction vector. draft
authorBoris Chiou <boris.chiou@gmail.com>
Wed, 16 Aug 2017 11:19:38 +0800
changeset 649375 9517cf8e622f63c134884673aa96218e4f4e9003
parent 649374 fc968e22182f7834c38ae1c3fe96bcbe18d7eee0
child 649376 11cfa6c1a09ef8db0269e315a0ffd9a2ebadc2ed
push id75033
push userbmo:boris.chiou@gmail.com
push dateSat, 19 Aug 2017 17:59:48 +0000
bugs1389429
milestone57.0a1
Bug 1389429 - Part 1: Add a test for rotate3d with the non-nomalizable direction vector. MozReview-Commit-ID: 70ZMe0QJbG5
dom/animation/test/mochitest.ini
dom/animation/test/style/test_transform-non-normalizable-rotate3d.html
--- a/dom/animation/test/mochitest.ini
+++ b/dom/animation/test/mochitest.ini
@@ -119,8 +119,9 @@ skip-if = toolkit == 'android'
 [mozilla/test_underlying-discrete-value.html]
 [style/test_animation-seeking-with-current-time.html]
 [style/test_animation-seeking-with-start-time.html]
 [style/test_animation-setting-effect.html]
 [style/test_composite.html]
 [style/test_interpolation-from-interpolatematrix-to-none.html]
 [style/test_missing-keyframe.html]
 [style/test_missing-keyframe-on-compositor.html]
+[style/test_transform-non-normalizable-rotate3d.html]
new file mode 100644
--- /dev/null
+++ b/dom/animation/test/style/test_transform-non-normalizable-rotate3d.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<meta charset=utf-8>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<script src='../testcommon.js'></script>
+<div id='log'></div>
+<script type='text/javascript'>
+'use strict';
+
+test(function(t) {
+  var target = addDiv(t);
+  target.style.transform = 'rotate3d(0, 0, 1, 90deg)';
+  target.style.transition = 'all 10s linear -5s';
+  getComputedStyle(target).transform;
+
+  target.style.transform = 'rotate3d(0, 0, 0, 270deg)';
+  var interpolated_matrix = 'matrix(' + Math.cos(Math.PI / 4) + ',' +
+                                        Math.sin(Math.PI / 4) + ',' +
+                                       -Math.sin(Math.PI / 4) + ',' +
+                                        Math.cos(Math.PI / 4) + ',' +
+                                        '0, 0)';
+  assert_matrix_equals(getComputedStyle(target).transform, interpolated_matrix,
+                       'transition from a normal rotate3d to a ' +
+                       'non-normalizable rotate3d');
+}, 'Test interpolation on non-normalizable rotate3d function');
+
+</script>
+</html>