Bug 1096013 - Add a test that ensures that we don't lose the favicon for background tabs that crash. r=mikedeboer

MozReview-Commit-ID: BoF62uPSfUC

--HG--
extra : rebase_source : 5549eaa87adcf93b81dbebc6e7e69c3ab5fc0e78
This commit is contained in:
Mike Conley 2017-03-24 10:26:49 -04:00
parent 039c9ecb61
commit e5f75b2640
2 changed files with 34 additions and 0 deletions

View File

@ -246,3 +246,5 @@ skip-if = !e10s # GroupedSHistory is e10s-only
[browser_closed_objects_changed_notifications_tabs.js]
[browser_closed_objects_changed_notifications_windows.js]
[browser_duplicate_history.js]
[browser_tabicon_after_bg_tab_crash.js]
skip-if = !e10s # Tabs can't crash without e10s

View File

@ -0,0 +1,32 @@
"use strict";
const FAVICON = "data:image/gif;base64,R0lGODlhCwALAIAAAAAA3pn/ZiH5BAEAAAEALAAAAAALAAsAAAIUhA+hkcuO4lmNVindo7qyrIXiGBYAOw==";
const PAGE_URL = `data:text/html,
<html>
<head>
<link rel="shortcut icon" href="${FAVICON}">
</head>
<body>
Favicon!
</body>
</html>`;
/**
* Tests that if a background tab crashes that it doesn't
* lose the favicon in the tab.
*/
add_task(function* test_tabicon_after_bg_tab_crash() {
let originalTab = gBrowser.selectedTab;
yield BrowserTestUtils.withNewTab({
gBrowser,
url: PAGE_URL,
}, function*(browser) {
Assert.equal(browser.mIconURL, FAVICON, "Favicon is correctly set.");
yield BrowserTestUtils.switchTab(gBrowser, originalTab);
yield BrowserTestUtils.crashBrowser(browser,
false /* shouldShowTabCrashPage */);
Assert.equal(browser.mIconURL, FAVICON,
"Favicon is still set after crash.");
});
});