Remove usage of /deep/ from PolymerTest.testIronIcons |
||||
Issue descriptionPolymerTest.testIronIcons is using /deep/ to find all iron-icon instances within the page and run some additional test within tearDown(). /deep/ does not work in Shadow DOM V1, and needs to be removed (see issue 860069). I see two options for testIronIcons() 1) Author a recursive querySelectorAll() method in JS (this is not that hard), and replace usage of /deep/ with that. (It might be much slower though). 2) Remove the testIronIcons() checks completely (they were added at r399301). I would be fine with 2, as I have not found these checks particularly useful (and did not even know they exist until recently). In general, running additional checks as part of every single Polymer test seems a bit excessive, and also reminds me of the old way of running a11y checks after every test (which was confusing and has now been disabled for newer WebUIs, in favor of dedicated a11y tests). @michaelpg, devlin: Any thoughts on this? [1] https://cs.chromium.org/chromium/src/chrome/test/data/webui/polymer_browser_test_base.js?l=112
,
Sep 19
,
Sep 19
IIRC, dbeam@, michaelpg@, and I were all pretty excited about the iron icon test, since it effectively ensured that the developer actually included the file that defined the icon image (which is not something that's usually tested automatically). I'd be a little sad to see it go, assuming it still worked to detect these issues.* If we can find a reasonably simplistic, efficient-ish way of doing this, it seems like it may be worthwhile. (An alternative would be suggesting each WebUI implement a test that call a testIronIcons() method or a single testIronIcons() method that navigates to each webui - either of those seem harder to maintain, since we'd have to manually update the set of what to test.) *Polymer has changed, so if this *doesn't* still detect issues, we should either find another way or scrap it.
,
Sep 19
this is really testing my memory, but I'm pretty sure we created this test because missing-icon bugs kept happening. Unfortunately we can't know how many bugs the test function has prevented. it's a shame iron-icon doesn't just assert that _svgIcon gets set when it calls iron-iconset-svg's applyIcon(). Do we know how slow (1) would really be? I understand it's not super efficient, but I doubt it would noticeably affect test durations.
,
Sep 19
> Do we know how slow (1) would really be? I understand it's not super efficient, but I doubt it would noticeably affect test durations. Have not tried this yet, but the code I had in mind can be seen at [1] (see findMatchingElements function). This was in a review's intermediate patch and ended up not landing, so we would need to revive that function. @rbpotter: Had done some bencmarking at the time, since this was originally meant to be used in Settings' search. I don't recall the exact numbers but IIRC it was significantly slower. [1] https://chromium-review.googlesource.com/c/chromium/src/+/1100102/1/ui/webui/resources/js/search_highlight_utils.js
,
Dec 11
|
||||
►
Sign in to add a comment |
||||
Comment 1 by dpa...@chromium.org
, Sep 19