mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 17:55:50 +00:00
4902b5d260
This evolves restoreScratchpadSession into restoreDevToolsSession which can keep track of more than just scratchpad windows. In this case we also restore the Browser Console. MozReview-Commit-ID: D4vOGkpq8xH --HG-- extra : rebase_source : 33f1a2183ee717c79f360a7dda688832a5c33566
33 lines
1.2 KiB
JavaScript
33 lines
1.2 KiB
JavaScript
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
|
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
// Check that the browser console gets session state is set correctly, and that
|
|
// it re-opens when restore is requested.
|
|
|
|
"use strict";
|
|
|
|
add_task(async function() {
|
|
is(HUDService.getBrowserConsoleSessionState(), false, "Session state false by default");
|
|
HUDService.storeBrowserConsoleSessionState();
|
|
is(HUDService.getBrowserConsoleSessionState(), false,
|
|
"Session state still not true even after setting (since Browser Console is closed)");
|
|
|
|
await HUDService.toggleBrowserConsole();
|
|
HUDService.storeBrowserConsoleSessionState();
|
|
is(HUDService.getBrowserConsoleSessionState(), true,
|
|
"Session state true (since Browser Console is opened)");
|
|
|
|
info("Closing the browser console and waiting for the session restore to reopen it")
|
|
await HUDService.toggleBrowserConsole();
|
|
|
|
let opened = waitForBrowserConsole();
|
|
gDevTools.restoreDevToolsSession({
|
|
browserConsole: true
|
|
});
|
|
|
|
info("Waiting for the console to open after session restore")
|
|
await opened;
|
|
});
|