Closed Bug 1499569 Opened Last year Closed Last year

Improve mochitest test_flex_items.html

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(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 dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/daf3e491e6ff
Rewrite test_flex_items.html to be simpler & easier to extend. r=bradwerth
Backed out for test_flex_items.html failures

backout: https://hg.mozilla.org/integration/autoland/rev/99c45aca2d8a868eb9e6c3c5543af78954839934

push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=daf3e491e6fff54278e1564b7b7c25f115076e1c&selectedJob=206016919

failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=206016919&repo=autoland&lineNumber=3357

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 - SimpleTest.is@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:312:5
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:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=e85baa0183739ef5ad17790631b058a571394b4d
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 dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f6642653fb17
Rewrite test_flex_items.html to be simpler & easier to extend. r=bradwerth
https://hg.mozilla.org/mozilla-central/rev/f6642653fb17
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.