browser_console_restore.js 1.1 KB

123456789101112131415161718192021222324252627282930
  1. /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
  2. /* Any copyright is dedicated to the Public Domain.
  3. * http://creativecommons.org/publicdomain/zero/1.0/ */
  4. // Check that the browser console gets session state is set correctly, and that
  5. // it re-opens when restore is requested.
  6. "use strict";
  7. add_task(function* () {
  8. is(HUDService.getBrowserConsoleSessionState(), false, "Session state false by default");
  9. HUDService.storeBrowserConsoleSessionState();
  10. is(HUDService.getBrowserConsoleSessionState(), false,
  11. "Session state still not true even after setting (since Browser Console is closed)");
  12. yield HUDService.toggleBrowserConsole();
  13. HUDService.storeBrowserConsoleSessionState();
  14. is(HUDService.getBrowserConsoleSessionState(), true,
  15. "Session state true (since Browser Console is opened)");
  16. info("Closing the browser console and waiting for the session restore to reopen it")
  17. yield HUDService.toggleBrowserConsole();
  18. let opened = waitForBrowserConsole();
  19. HUDService.restoreBrowserConsoleSession();
  20. info("Waiting for the console to open after session restore")
  21. yield opened;
  22. });