Bug 1276271 P2 Verify responsive design UI does not leak when window is closed. r=jryans
authorBen Kelly <ben@wanderview.com>
Sat, 28 May 2016 05:59:09 -0700
changeset 299417 17d8abb5b1803418ea206cd60fe5386dc8dded98
parent 299416 55dc8f7c505ce35a04ade9c2f00d0a3dd9dba790
child 299418 d58e8b384d3ed41a9008ae4991a3218ebc43950b
push id77561
push userbkelly@mozilla.com
push dateSat, 28 May 2016 12:59:15 +0000
treeherdermozilla-inbound@17d8abb5b180 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1276271
milestone49.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 1276271 P2 Verify responsive design UI does not leak when window is closed. r=jryans
devtools/client/responsivedesign/test/browser.ini
devtools/client/responsivedesign/test/browser_responsiveui_window_close.js
--- a/devtools/client/responsivedesign/test/browser.ini
+++ b/devtools/client/responsivedesign/test/browser.ini
@@ -12,8 +12,9 @@ support-files =
 skip-if = e10s && debug # Bug 1252201 - Docshell leak on debug e10s
 [browser_responsiveruleview.js]
 skip-if = e10s && debug # Bug 1252201 - Docshell leak on debug e10s
 [browser_responsiveui.js]
 [browser_responsiveui_touch.js]
 [browser_responsiveuiaddcustompreset.js]
 [browser_responsive_devicewidth.js]
 [browser_responsiveui_customuseragent.js]
+[browser_responsiveui_window_close.js]
new file mode 100644
--- /dev/null
+++ b/devtools/client/responsivedesign/test/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;
+});