mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 18:26:15 +00:00
8fcb34f772
I don't understand how the test ever worked. I think the idea was that each operation would result in changes to the prefs, because those prefs are the source of truth for the recent-files list. However, I don't understand why some tests would not trigger multiple observer callbacks, which should have been a huge mess. The new code doesn't observe the prefs at all. Where possible, it waits for an appropriate promise; in other places it uses `setTimeout()` to wait for the next tick, relying on the Scratchpad implementation to be done reacting by then. Since the original code was event-driven, most tests were split across two functions. Each test function had the bottom half of one test and the top half of the next test. The new code uses async/await and can therefore at least group related functionality into single cohesive test functions. But those test functions aren't as independent as they look -- most of them still depend on previous tests to set up the expected starting state. Differential Revision: https://phabricator.services.mozilla.com/D20759 --HG-- extra : moz-landing-system : lando |
||
---|---|---|
.. | ||
client | ||
docs | ||
platform | ||
server | ||
shared | ||
startup | ||
.eslintrc.js | ||
.eslintrc.mochitests.js | ||
.eslintrc.xpcshell.js | ||
CODE_OF_CONDUCT.md | ||
moz.build | ||
templates.mozbuild |