--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_context_menu_store_as_global.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_context_menu_store_as_global.js
@@ -11,24 +11,26 @@
const TEST_URI = `data:text/html;charset=utf-8,<script>
window.bar = { baz: 1 };
console.log("foo");
console.log("foo", window.bar);
window.array = ["foo", window.bar, 2];
console.log(window.array);
window.longString = "foo" + "a".repeat(1e4);
console.log(window.longString);
+ window.symbol = Symbol();
+ console.log("foo", window.symbol);
</script>`;
add_task(async function() {
let hud = await openNewTabAndConsole(TEST_URI);
let messages = await waitFor(() => findMessages(hud, "foo"));
- is(messages.length, 4, "Four messages should have appeared");
- let [msgWithText, msgWithObj, msgNested, msgLongStr] = messages;
+ is(messages.length, 5, "Five messages should have appeared");
+ let [msgWithText, msgWithObj, msgNested, msgLongStr, msgSymbol] = messages;
let varIdx = 0;
info("Check store as global variable is disabled for text only messages");
await storeAsVariable(hud, msgWithText, "string");
info("Check store as global variable is disabled for text in complex messages");
await storeAsVariable(hud, msgWithObj, "string");
@@ -39,16 +41,19 @@ add_task(async function() {
await storeAsVariable(hud, msgNested, "array", varIdx++, "window.array");
info("Check store as global variable is enabled for nested object in nested messages");
await storeAsVariable(hud, msgNested, "object", varIdx++, "window.bar");
info("Check store as global variable is enabled for long strings");
await storeAsVariable(hud, msgLongStr, "string", varIdx++, "window.longString");
+ info("Check store as global variable is enabled for symbols");
+ await storeAsVariable(hud, msgSymbol, "symbol", varIdx++, "window.symbol");
+
info("Check store as global variable is enabled for invisible-to-debugger objects");
let onMessageInvisible = waitForMessage(hud, "foo");
ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
let obj = Cu.Sandbox(Cu.getObjectPrincipal(content), {invisibleToDebugger: true});
content.wrappedJSObject.invisibleToDebugger = obj;
content.console.log("foo", obj);
});
let msgInvisible = (await onMessageInvisible).node;