summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js')
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js50
1 files changed, 49 insertions, 1 deletions
diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js b/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js
index 7ed70b3310..d7c71aade8 100644
--- a/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js
@@ -98,6 +98,25 @@ add_task(async function () {
"Pending selected location is the expected one"
);
+ const footerButton = findElement(dbg, "sourceMapFooterButton");
+ is(
+ footerButton.textContent,
+ "original file",
+ "The source map button's label mention an original file"
+ );
+ ok(
+ footerButton.classList.contains("original"),
+ "The source map icon is original"
+ );
+ ok(
+ !footerButton.classList.contains("not-mapped"),
+ "The source map button isn't gray out"
+ );
+ ok(
+ !footerButton.classList.contains("loading"),
+ "The source map button isn't reporting in-process loading"
+ );
+
info("Click on jump to generated source link from editor's footer");
let mappedSourceLink = findElement(dbg, "mappedSourceLink");
is(
@@ -117,6 +136,23 @@ add_task(async function () {
"From entry.js",
"The link to mapped source mentions the original source"
);
+ is(
+ footerButton.textContent,
+ "bundle file",
+ "When moved to the bundle, the source map button's label mention a bundle file"
+ );
+ ok(
+ !footerButton.classList.contains("original"),
+ "The source map icon isn't original"
+ );
+ ok(
+ !footerButton.classList.contains("not-mapped"),
+ "The source map button isn't gray out"
+ );
+ ok(
+ !footerButton.classList.contains("loading"),
+ "The source map button isn't reporting in-process loading"
+ );
info("Move the cursor within the bundle to another original source");
getCM(dbg).setCursor({ line: 70, ch: 0 });
@@ -126,6 +162,18 @@ add_task(async function () {
"From times2.js",
"The link to mapped source updates to the newly selected original source within the bundle"
);
+
+ info("Move to the new original file via the source map button/menu");
+ await clickOnSourceMapMenuItem(dbg, ".debugger-jump-mapped-source");
+ await waitForSelectedSource(dbg, "times2.js");
+
+ info("Open the related source map file and wait for a new tab to be opened");
+ const onTabLoaded = BrowserTestUtils.waitForNewTab(
+ gBrowser,
+ `view-source:${EXAMPLE_URL}sourcemaps/bundle.js.map`
+ );
+ await clickOnSourceMapMenuItem(dbg, ".debugger-source-map-link");
+ await onTabLoaded;
});
function assertBreakpointExists(dbg, source, line) {
@@ -143,5 +191,5 @@ async function waitForBreakpointCount(dbg, count) {
const {
selectors: { getBreakpointCount },
} = dbg;
- await waitForState(dbg, state => getBreakpointCount() == count);
+ await waitForState(dbg, () => getBreakpointCount() == count);
}