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 687793 9fe75b33cd5f24872ebb92fe6b8e461c22739609
parent 687792 73d3c5bfbe2996543250e5e6335e49a9981fdb9a
child 737742 f8a878857c6780747b794cabcdd03faade5163f0
push id86604
push userbmo:boris.chiou@gmail.com
push dateFri, 27 Oct 2017 19:27:11 +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++) {