Closed
Bug 1373271
Opened 8 years ago
Closed 8 years ago
Handle crashes in preloaded browsers in tabbrowser
Categories
(Firefox Graveyard :: Activity Streams: General, enhancement)
Firefox Graveyard
Activity Streams: General
Tracking
(firefox56 fixed)
RESOLVED
FIXED
Firefox 56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: k88hudson, Assigned: k88hudson)
References
Details
Attachments
(1 file)
When testing with activity-stream pref'd on, we discovered that crashes in a preloaded browser were throwing exceptions in following test:
browser/components/sessionstore/test/browser_background_tab_crash.js
The main problem is that preloaded browsers don't actually contain any tabs, so getTabForContent will end up returning undefined.
Instead, we should just releases the crashed preloaded browser.
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → khudson
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Attachment #8878087 -
Flags: review?(mconley)
Comment 2•8 years ago
|
||
mozreview-review |
Comment on attachment 8878087 [details]
Bug 1373271 - Handle crashes in preloaded browsers in tabbrowser
https://reviewboard.mozilla.org/r/149498/#review154062
This looks great, k88hudson, thanks!
Just two suggestions, see below.
::: browser/base/content/tabbrowser.xml:5621
(Diff revision 1)
> let browser = event.originalTarget;
> +
> + // Preloaded browsers do not actually have any tabs. If one crashes,
> + // it should simply be removed.
> + if (browser === this._preloadedBrowser) {
> + let preloaded = this._getPreloadedBrowser();
Maybe it'd be worth mentioning that we're not just doing `browser.remove();` because `_getPreloadedBrowser()` is needed to _consume_ the preloaded browser.
::: browser/components/sessionstore/test/browser_background_tab_crash.js:232
(Diff revision 1)
> + }
> +
> + let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:robots");
> + Assert.ok(gBrowser._preloadedBrowser);
> +
> + await BrowserTestUtils.crashBrowser(gBrowser._preloadedBrowser, false);
By default, the preloaded browser is at about:newtab, which is not crash-able.
So I think this exception is going to be thrown:
http://searchfox.org/mozilla-central/rev/c49a70b53f67dd5550eec8a08793805f2aca8d42/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm#990
We should probably either:
a) Ensure that Activity Stream is enabled for this particular subtest, and that the preloaded browser is browsed to it (and remote).
b) Manually browse the preloaded browser to a remote location, like http://example.com (which is a special URI in Mochitests, and doesn't actually hit the network, but is treated like a web address).
Attachment #8878087 -
Flags: review?(mconley) → review-
Comment hidden (mozreview-request) |
Comment 4•8 years ago
|
||
mozreview-review |
Comment on attachment 8878087 [details]
Bug 1373271 - Handle crashes in preloaded browsers in tabbrowser
https://reviewboard.mozilla.org/r/149498/#review154612
Assuming a green try run, r=me! Good stuff!
::: browser/components/sessionstore/test/browser_background_tab_crash.js:223
(Diff revision 2)
> await tabRestored;
> });
> });
> });
> +
> +// Tests that preloaded tabs are removed and no unexpected errors are thrown.
"Tests that preloaded tabs are removed" -> "Tests that crashed preloaded tabs are removed".
Attachment #8878087 -
Flags: review?(mconley) → review+
Comment hidden (mozreview-request) |
Pushed by khudson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/65ff5356cdfa
Handle crashes in preloaded browsers in tabbrowser r=mconley
Backed out for apparently leaking a window: https://treeherder.mozilla.org/logviewer.html#?job_id=108355458&repo=autoland
https://hg.mozilla.org/integration/autoland/rev/14f4d223c014d7dae4302e7cbe2450e0488d3c3f
Flags: needinfo?(khudson)
Comment 8•8 years ago
|
||
mozreview-review |
Comment on attachment 8878087 [details]
Bug 1373271 - Handle crashes in preloaded browsers in tabbrowser
https://reviewboard.mozilla.org/r/149498/#review155750
::: browser/components/sessionstore/test/browser_background_tab_crash.js:236
(Diff revision 3)
> + // Release any existing preloaded browser
> + gBrowser._getPreloadedBrowser();
Whoops, I missed this. :/
We're consuming the preloaded browser here, but it's still in the DOM. You should probably do somethign like:
```js
let preloaded = gBrowser._getPreloadedBrowser();
preloaded.remove();
```
To fully clear it out.
Comment hidden (mozreview-request) |
Comment 10•8 years ago
|
||
Pushed by khudson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/761383b60ca2
Handle crashes in preloaded browsers in tabbrowser r=mconley
Comment 11•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 56
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(khudson)
Updated•1 year ago
|
Product: Firefox → Firefox Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•