browser_responsiveui_window_close.js 873 B

1234567891011121314151617181920212223242526
  1. /* Any copyright is dedicated to the Public Domain.
  2. http://creativecommons.org/publicdomain/zero/1.0/ */
  3. "use strict";
  4. add_task(function* () {
  5. let newWindowPromise = BrowserTestUtils.waitForNewWindow();
  6. window.open("about:blank", "_blank");
  7. let newWindow = yield newWindowPromise;
  8. newWindow.focus();
  9. yield once(newWindow.gBrowser, "load", true);
  10. let tab = newWindow.gBrowser.selectedTab;
  11. yield ResponsiveUIManager.openIfNeeded(newWindow, tab);
  12. // Close the window on a tab with an active responsive design UI and
  13. // wait for the UI to gracefully shutdown. This has leaked the window
  14. // in the past.
  15. ok(ResponsiveUIManager.isActiveForTab(tab),
  16. "ResponsiveUI should be active for tab when the window is closed");
  17. let offPromise = once(ResponsiveUIManager, "off");
  18. yield BrowserTestUtils.closeWindow(newWindow);
  19. yield offPromise;
  20. });