diff options
Diffstat (limited to 'devtools/client/debugger/test/mochitest/browser_dbg-console-link.js')
-rw-r--r-- | devtools/client/debugger/test/mochitest/browser_dbg-console-link.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-console-link.js b/devtools/client/debugger/test/mochitest/browser_dbg-console-link.js new file mode 100644 index 0000000000..3a648c4601 --- /dev/null +++ b/devtools/client/debugger/test/mochitest/browser_dbg-console-link.js @@ -0,0 +1,25 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ + +"use strict"; + +// Tests opening the console first, clicking a link +// opens the editor at the correct location. + +add_task(async function() { + const toolbox = await initPane("doc-script-switching.html", "webconsole"); + const node = await waitForLink(toolbox); + node.click(); + + await waitFor(() => toolbox.getPanel("jsdebugger")); + const dbg = createDebuggerContext(toolbox); + await waitForElementWithSelector(dbg, ".CodeMirror-code > .highlight-line"); + assertHighlightLocation(dbg, "script-switching-02", 14); +}); + +async function waitForLink(toolbox) { + const { hud } = toolbox.getPanel("webconsole"); + + return waitFor(() => hud.ui.outputNode.querySelector(".frame-link-source")); +} |