1 add_task(async function () {
2 // Test text and expected results.
4 ["/*# sourceMappingURL=here*/", "here"],
5 ["/*# sourceMappingURL=here */", "here"],
6 ["/*@ sourceMappingURL=here*/", "here"],
7 ["/*@ sourceMappingURL=there*/ /*# sourceMappingURL=here*/", "here"],
8 ["/*# sourceMappingURL=here there */", "here"],
10 ["/*# sourceMappingURL= here */", ""],
11 ["/*# sourceMappingURL=*/", ""],
12 ["/*# sourceMappingUR=here */", ""],
13 ["/*! sourceMappingURL=here */", ""],
14 ["/*# sourceMappingURL = here */", ""],
15 ["/* # sourceMappingURL=here */", ""],
18 let page = "<!DOCTYPE HTML>\n<html>\n<head>\n";
19 for (let i = 0; i < test_cases.length; ++i) {
20 page += `<style type="text/css"> #x${i} { color: red; }${test_cases[i][0]}</style>\n`;
22 page += "</head><body>some text</body></html>";
24 let uri = "data:text/html;base64," + btoa(page);
25 info(`URI is ${uri}`);
27 await BrowserTestUtils.withNewTab(
32 async function (browser) {
33 await SpecialPowers.spawn(browser, [test_cases], function (tests) {
34 for (let i = 0; i < content.document.styleSheets.length; ++i) {
35 let sheet = content.document.styleSheets[i];
37 info(`Checking sheet #${i}`);
41 `correct source map for sheet ${i}`