Closed Bug 1499569 Opened Last year Closed Last year

Improve mochitest test_flex_items.html


(Core :: Layout: Flexbox, enhancement, P3)




Tracking Status
firefox64 --- fixed


(Reporter: dholbert, Assigned: dholbert)




(1 file)

I've rewritten the mochitest test_flex_items.html a bit to make it easier to follow/extend.  Filing this bug to cover that.
Primary changes:
 - Rewrap some lines that are too long.
 - Adjust some failure-messages with s/has/should have/ etc.
 - Replace 'nearlyEqual' function with the standard mochitest
   'isfuzzy()' API (which is like 'is()' with an extra epsilon arg)
 - Remove dependence on hardcoded element IDs, and simply walk over the
   flex container's children in order instead (still noting each child node
   and making sure it matches the node in the flex API).
Pushed by
Rewrite test_flex_items.html to be simpler & easier to extend. r=bradwerth
Backed out for test_flex_items.html failures


push with failures:

failure log:

22:54:53     INFO - TEST-UNEXPECTED-FAIL | dom/flex/test/chrome/test_flex_items.html | Item index 1 has expected mainBaseSize. - got 83.95, expected 83.94999694824219
22:54:53     INFO -
22:54:53     INFO - testItemMatchesExpectedValues@chrome://mochitests/content/chrome/dom/flex/test/chrome/test_flex_items.html:56:5
22:54:53     INFO - runTests@chrome://mochitests/content/chrome/dom/flex/test/chrome/test_flex_items.html:159:5
22:54:53     INFO - onload@chrome://mochitests/content/chrome/dom/flex/test/chrome/test_flex_items.html:1:1
22:54:53     INFO - TEST-PASS | dom/flex/test/chrome/test_flex_items.html | Item index 1 has expected mainDeltaSize.
Flags: needinfo?(dholbert)
Blocks: 1499606
This is for the element that (formerly) had id="second".  The mainBaseSize is off by a very very tiny amount, but this particular comparison is made with "is()", so it's expected to be exact. (And the fractional number here comes from the bounding-box size, `lbElemBoundingRect.width`, so it can be kinda arbitrarily fractional, if it comes from content.)

I realized there's one CSS rule that I forgot to remove/fold-in for this element:
>  #second       { width: 100px; }
(no longer honored because the element no longer has id="second")

Locally, I've now removed that rule and given the element style="width:100px", and I suspect that'll address that failure. (It'll probably be comparing mainBaseSize of 100 == bounding box size of 100 now.)

Here's a try run with that fix:
Blocks: 1499875
Turns out there's a huge mac test-run backlog, so I still don't have mac test results.

I just validated locally (on Linux) that I'm now seeing item.mainBaseSize==values.mainBaseSize==100 (not some fractional value) for this item, which means I should be OK to re-land without getting fractional sizes around 83.95 anymore.
Flags: needinfo?(dholbert)
Pushed by
Rewrite test_flex_items.html to be simpler & easier to extend. r=bradwerth
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.