Bug 1340005 - Part 8: Remove tolerance for omta tests. draft
authorBoris Chiou <boris.chiou@gmail.com>
Fri, 06 Oct 2017 17:59:02 +0800
changeset 683868 758d589fa34ee9881895b28dc3ea3287ba319d32
parent 683867 d315535081b14b99bc10a49afdbb045568cc3b6b
child 736738 075e259a2585fa76ed58d3560a9921152a2085f5
push id85475
push userbmo:boris.chiou@gmail.com
push dateFri, 20 Oct 2017 10:06:12 +0000
bugs1340005
milestone58.0a1
Bug 1340005 - Part 8: Remove tolerance for omta tests. 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++) {