mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1121052
- Reset the zoom level for crashed tab pages.
This commit is contained in:
parent
fc54b99038
commit
113dd9e919
@ -1135,11 +1135,15 @@ var gBrowserInit = {
|
||||
});
|
||||
|
||||
gBrowser.addEventListener("AboutTabCrashedLoad", function(event) {
|
||||
let browser = gBrowser.getBrowserForDocument(event.target);
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
TabCrashReporter.onAboutTabCrashedLoad(gBrowser.getBrowserForDocument(event.target), {
|
||||
TabCrashReporter.onAboutTabCrashedLoad(browser, {
|
||||
crashedTabCount: SessionStore.crashedTabCount,
|
||||
});
|
||||
#endif
|
||||
|
||||
// Reset the zoom for the tabcrashed page.
|
||||
ZoomManager.setZoomForBrowser(browser, 1);
|
||||
}, false, true);
|
||||
|
||||
gBrowser.addEventListener("AboutTabCrashedMessage", function(event) {
|
||||
|
@ -387,3 +387,33 @@ add_task(function* test_hide_restore_all_button() {
|
||||
gBrowser.removeTab(newTab);
|
||||
gBrowser.removeTab(newTab2);
|
||||
});
|
||||
|
||||
add_task(function* test_aboutcrashedtabzoom() {
|
||||
let newTab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = newTab;
|
||||
let browser = newTab.linkedBrowser;
|
||||
ok(browser.isRemoteBrowser, "Should be a remote browser");
|
||||
yield promiseBrowserLoaded(browser);
|
||||
|
||||
browser.loadURI(PAGE_1);
|
||||
yield promiseBrowserLoaded(browser);
|
||||
|
||||
FullZoom.enlarge();
|
||||
let zoomLevel = ZoomManager.getZoomForBrowser(browser);
|
||||
ok(zoomLevel !== 1, "should have enlarged");
|
||||
|
||||
yield TabStateFlusher.flush(browser);
|
||||
|
||||
// Crash the tab
|
||||
yield crashBrowser(browser);
|
||||
|
||||
ok(ZoomManager.getZoomForBrowser(browser) === 1, "zoom should have reset on crash");
|
||||
|
||||
clickButton(browser, "restoreTab");
|
||||
yield promiseTabRestored(newTab);
|
||||
|
||||
ok(ZoomManager.getZoomForBrowser(browser) === zoomLevel, "zoom should have gone back to enlarged");
|
||||
FullZoom.reset();
|
||||
|
||||
gBrowser.removeTab(newTab);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user