From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- .../test/mochitest/browser_dbg-sourcemaps-bogus.js | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-bogus.js') diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-bogus.js b/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-bogus.js index e9e3a3c7f2..79a8245613 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-bogus.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-bogus.js @@ -53,6 +53,16 @@ add_task(async function () { "There is a warning about the missing source map file" ); + let footerButton = findElement(dbg, "sourceMapFooterButton"); + ok( + footerButton.classList.contains("not-mapped"), + "The source map error causes the file to be reported as not mapped" + ); + ok( + footerButton.classList.contains("error"), + "The source map error is displayed in the source map icon" + ); + // Test a Source Map with missing original text content await selectSource(dbg, "map-with-failed-original-request.js"); ok( @@ -87,5 +97,24 @@ add_task(async function () { `Error while fetching an original source: request failed with status 404\nSource URL: ${EXAMPLE_URL}map-with-failed-original-request.original.js` ); + footerButton = findElement(dbg, "sourceMapFooterButton"); + is( + footerButton.textContent, + "original file", + "Even if the original can't be loaded, it is reported as original in the footer" + ); + ok( + !footerButton.classList.contains("loading"), + "The source map isn't loading because of the missing text content" + ); + ok( + !footerButton.classList.contains("error"), + "The source map isn't reported with an error because of the missing text content" + ); + ok( + footerButton.classList.contains("original"), + "The source map icon is set to original" + ); + await resume(dbg); }); -- cgit v1.2.3