gecko-dev/devtools/client/scratchpad
Jason Orendorff 8fcb34f772 Bug 1525395 - Part 2: Rewrite a Scratchpad test to eliminate some race conditions. r=jimb
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
2019-03-06 23:04:01 +00:00
..
test Bug 1525395 - Part 2: Rewrite a Scratchpad test to eliminate some race conditions. r=jimb 2019-03-06 23:04:01 +00:00
index.xul Bug 1512434 - Remove pretty-printing from the debugger server and related tooling. r=jlast 2018-12-10 17:02:02 +00:00
moz.build Bug 1462399 - remove GCLI commands; r=ochameau 2018-09-03 17:24:32 +00:00
panel.js Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (automatic fixes). r=mossop 2018-10-19 12:55:39 +00:00
scratchpad-manager.jsm Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
scratchpad.js Bug 1525395 - Part 1: Make Scratchpad.openFile return a promise. r=jimb 2019-03-06 23:03:47 +00:00