Files
odoo_source/addons/mrp/static
Samuel Degueldre 6daa2d01b7 [IMP] web, *: use MutationObserver to neutralize image src in tests
*: mail, mrp

Previously, to prevent images and iframes from making  GET requests in
tests, we would listen for the DOMNodeInserted event. This event is
deprecated and should not be used. Additionally, we weren't listening
for attiribute changes for performance reasons, which would result in
some GET requests still being made when an src attribute was changed.

This commit changes the mechanism that is used to do this from mutation
events to a MutationObserver which is not deprecated, and now also
listens for attribute modifications as MutationObservers can be
configured to only listen for changes to certain attributes, greatly
alleviating the performance impact of listening for those.

This mechanism has also been enabled globally by doing it once in the
test setup code, instead of requiring one to call a specific helper, as
we never want to make real requests during tests.

Some tests have been adapted to this new behaviour.

closes odoo/odoo#85216

Related: odoo/enterprise#24665
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-23 15:07:59 +00:00
..
…
…