jetpack-addon-harness.js runs in a browser window scope so it already has the
setTimeout functions available to it. Loading Timer.jsm overrides the DOM
timer functions with those from Timer.jsm. Any other code that used setTimeout
previously will have timer IDs from the DOM functions which don't match those
in Timer.jsm. If this other code attempts to clear a timer it can then end up
clearing an unrelated timer. In the intermittent failure here the
browser-thumbnails code manages to clear the timer that is waiting to resolve
the promise that makes tests continue.
I've also added an additional timer that throws an exception and so ends tests
if the add-on uninstall doesn't actually complete in a reasonable time as well
as removing the add-on listener.
--HG--
extra : commitid : 663HV2HWrjK
extra : rebase_source : 35fae1264532555c4b51ef964eae27a5ff3230e1