Bug 1340005 - Part 8: Remove tolerance for omta tests. r=hiro
authorBoris Chiou <boris.chiou@gmail.com>
Fri, 06 Oct 2017 17:59:02 +0800
changeset 688121 b0de4b584e6dc55a41f4e36d8d07ebdfe58de0f1
parent 688120 3b54675c1eee8416b0a8da02b4f1025ade265159
child 688122 d852671509919ece8c57dc77e3dfad76c9edf5c8
push id86669
push userhikezoe@mozilla.com
push dateSat, 28 Oct 2017 10:13:18 +0000
reviewershiro
bugs1340005
milestone58.0a1
Bug 1340005 - Part 8: Remove tolerance for omta tests. r=hiro Just notice these precision errors are fixed by our other patches (i.e. not by this patch series). Anyway, it's time to remove the tolerance. MozReview-Commit-ID: 2ZDoRhuVOL8
layout/style/test/animation_utils.js
--- a/layout/style/test/animation_utils.js
+++ b/layout/style/test/animation_utils.js
@@ -401,25 +401,16 @@ const RunningOn = {
   TodoMainThread: 3
 };
 
 const ExpectComparisonTo = {
   Pass: 1,
   Fail: 2
 };
 
-// FIXME: Bug 1340005: We use |RawServoAnimationValue| on the main thread if
-// enabling Servo style backend, and still use |StyleAnimationValue| on the
-// compositor thread. |RawServoAnimationValue| rounds the interpolated results
-// to a nearest |app_units::Au| (i.e. i32), so we might have a tiny difference
-// between the results from getOMTAStyle() and getComputedStyle().
-// Note: 1 AU ~= 60 CSS pixel unit.
-const isStylo = SpecialPowers.DOMWindowUtils.isStyledByServo;
-const toleranceForServoBackend = isStylo ? 0.5 / 60.0 : 0.0;
-
 (function() {
   window.omta_todo_is = function(elem, property, expected, runningOn, desc,
                                  pseudo) {
     return omta_is_approx(elem, property, expected, 0, runningOn, desc,
                           ExpectComparisonTo.Fail, pseudo);
   };
 
   window.omta_is = function(elem, property, expected, runningOn, desc,
@@ -512,17 +503,17 @@ const toleranceForServoBackend = isStylo
     // the value calculated on the main thread
     if (actualStr === compositorStr) {
       var computedValue = normalize(computedStr);
       if (computedValue === null) {
         ok(false, desc + ": test framework should parse computed style" +
                   " - got " + computedStr);
         return;
       }
-      okOrTodo(compare(computedValue, actualValue, toleranceForServoBackend),
+      okOrTodo(compare(computedValue, actualValue, 0.0),
                desc + ": OMTA style and computed style should be equal" +
                " - OMTA " + actualStr + ", computed " + computedStr);
     }
   };
 
   window.matricesRoughlyEqual = function(a, b, tolerance) {
     tolerance = tolerance || 0.00011;
     for (var i = 0; i < 4; i++) {