Bug 1276271 P2 Verify responsive design UI does not leak when window is closed. r=jryans

This commit is contained in:
Ben Kelly 2016-05-28 05:59:09 -07:00
Родитель 64760e8d52
Коммит d9b5c79aac
2 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@ -17,3 +17,4 @@ skip-if = e10s && debug # Bug 1252201 - Docshell leak on debug e10s
[browser_responsiveuiaddcustompreset.js]
[browser_responsive_devicewidth.js]
[browser_responsiveui_customuseragent.js]
[browser_responsiveui_window_close.js]

Просмотреть файл

@ -0,0 +1,25 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
add_task(function* () {
let newWindowPromise = BrowserTestUtils.waitForNewWindow();
window.open("about:blank", "_blank");
let newWindow = yield newWindowPromise;
newWindow.focus();
yield once(newWindow.gBrowser, "load", true);
let tab = newWindow.gBrowser.selectedTab;
yield ResponsiveUIManager.runIfNeeded(newWindow, tab);
// Close the window on a tab with an active responsive design UI and
// wait for the UI to gracefully shutdown. This has leaked the window
// in the past.
ok(ResponsiveUIManager.isActiveForTab(tab),
"ResponsiveUI should be active for tab when the window is closed");
let offPromise = once(ResponsiveUIManager, "off");
yield BrowserTestUtils.closeWindow(newWindow);
yield offPromise;
});