On Thu, May 19, 2016, at 07:09 PM, Matthew N. wrote:
> Hello,
>
> One of the reasons developers have been avoiding pushPrefEnv compared to
> the synchronous set*Pref (with a registerCleanupFunction) is because
> pushPrefEnv required using a callback function to wait for the
> preference change before moving on in the test file. This can make the
> test flow more complicated (especially when using add_task) and
> therefore harder to follow.
>
> Bug 1197310[1] made pushPrefEnv/popPrefEnv/flushPrefEnv return a promise
> which resolves when the callbacks would have been called so now you can
> simply write test code like so:
>
> add_task(function* setup() {
> yield SpecialPowers.pushPrefEnv({"set": [["signon.debug", true]]});
> …
> })
This is a really great improvement, thanks!
-Ted
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform