Bug 1294509 - Enable browser_thumbnails_bg_crash_during_capture.js on e10s. r=markh
authorDrew Willcoxon <adw@mozilla.com>
Thu, 11 Aug 2016 20:12:38 -0700
changeset 309223 6f2ba7787816fd01f77c30e3bdb68400db74bf0c
parent 309222 61340bd78a4bf05890f4b84a6ca57ba01c0ee29b
child 309224 666549adf9c64d9756bc77319570440e04be7ad7
push id30558
push userkwierso@gmail.com
push dateFri, 12 Aug 2016 21:37:53 +0000
treeherdermozilla-central@2ed7e61b988d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs1294509
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1294509 - Enable browser_thumbnails_bg_crash_during_capture.js on e10s. r=markh MozReview-Commit-ID: 6cVbhXWdS0X
toolkit/components/thumbnails/BackgroundPageThumbs.jsm
toolkit/components/thumbnails/test/browser.ini
--- a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
+++ b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
@@ -224,18 +224,26 @@ const BackgroundPageThumbs = {
       this._destroyBrowser();
       let curCapture = this._captureQueue.length ? this._captureQueue[0] : null;
       // we could retry the pending capture, but it's possible the crash
       // was due directly to it, so trying again might just crash again.
       // We could keep a flag to indicate if it previously crashed, but
       // "resetting" the capture requires more work - so for now, we just
       // discard it.
       if (curCapture && curCapture.pending) {
-        curCapture._done(null, TEL_CAPTURE_DONE_CRASHED);
-        // _done automatically continues queue processing.
+        // Continue queue processing by calling curCapture._done().  Do it after
+        // this crashed listener returns, though.  A new browser will be created
+        // immediately (on the same stack as the _done call stack) if there are
+        // any more queued-up captures, and that seems to mess up the new
+        // browser's message manager if it happens on the same stack as the
+        // listener.  Trying to send a message to the manager in that case
+        // throws NS_ERROR_NOT_INITIALIZED.
+        Services.tm.currentThread.dispatch(() => {
+          curCapture._done(null, TEL_CAPTURE_DONE_CRASHED);
+        }, Ci.nsIEventTarget.DISPATCH_NORMAL);
       }
       // else: we must have been idle and not currently doing a capture (eg,
       // maybe a GC or similar crashed) - so there's no need to attempt a
       // queue restart - the next capture request will set everything up.
     });
 
     browser.messageManager.loadFrameScript(FRAME_SCRIPT_URL, false);
     this._thumbBrowser = browser;
--- a/toolkit/components/thumbnails/test/browser.ini
+++ b/toolkit/components/thumbnails/test/browser.ini
@@ -7,17 +7,17 @@ support-files =
   head.js
   privacy_cache_control.sjs
   thumbnails_background.sjs
   thumbnails_crash_content_helper.js
   thumbnails_update.sjs
 
 [browser_thumbnails_bg_bad_url.js]
 [browser_thumbnails_bg_crash_during_capture.js]
-skip-if = buildapp == 'mulet' || !crashreporter || e10s # crashing the remote thumbnailer crashes the remote test tab
+skip-if = buildapp == 'mulet' || !crashreporter
 [browser_thumbnails_bg_crash_while_idle.js]
 skip-if = buildapp == 'mulet' || !crashreporter
 [browser_thumbnails_bg_basic.js]
 [browser_thumbnails_bg_queueing.js]
 [browser_thumbnails_bg_timeout.js]
 [browser_thumbnails_bg_redirect.js]
 [browser_thumbnails_bg_destroy_browser.js]
 [browser_thumbnails_bg_no_cookies_sent.js]