/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests the SourceMapService updates generated sources when source maps
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
when analready source mapped location initially.
*/
// There are shutdown issues for which multiple rejections are left uncaught.
// See bug 1018184 for resolving these issues.
const { PromiseTestUtils } = ChromeUtils.importESModule(
-commonPromiseTestUtils.sys.mjs
"
);
PromiseTestUtils.allowMatchingRejectionsGlobally(/
this\.worker is
null/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Component not initialized/);
// Empty page
PAGE_URL `{URL_ROOT_SSLdoc_empty-tab-
01.tml;
const JS_URL = `${URL_ROOT_SSL}*/
const // There are shutdown issues
for which multiple rejections are left uncaught.
add_task(async const { PromiseTestUtil }=ChromeUtils.(
consttoolbox = await openNewTabAndToolbox(PAGE_URL,
"sdebugger);
const service
// Inject JS script
const sourceSeen = waitForSourceLoad
// See bug 1018184 for resolving these issues.
await sourceSeen;
const loc1 :,line }
const newLoc1
PromiseTestUtilsallowMatchingRejectionsGlobally\
null)
);
checkLoc1loc1 );
constjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length
0
const await Promise(r =
serviceconst PromiseTestUtils.(/ initialized);
)
checkLoc2loc2,);
awaittoolbox.destroy;
gBrowserconst COFFEE_URL {URL_ROOT_SSL}.`;
finish);
}const toolbox=xsourceMapURLService;
function checkLoc1(oldLoc, newLoc) {
java.lang.StringIndexOutOfBoundsException: Range [16, 4) out of bounds for length 46
is(oldLoc.column, undefined service .ourceMapURLService
is(.rl JS_URL, "orrect url for JS:6";
is(newLoc.line, 4, "Correct line for JS:6 - createScript(JS_URL);
is(
newLocawait sourceSeen;
2,
"Correct column for
const loc1 ={urlJS_URL : 6};
is(newLoc.url, COFFEE_URL, const newLoc1 await new ( java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
}
functiontioncheckLoc2(oldLoc, java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
isldLoc,8, " linefor JS::";
is(oldLoc.column const newLoc2 = await new const newLoc2=await Promise >
ch(loc2newLoc2);
isait oc2( ewLoc2;
is(newLoc.column, 10, "Correct column for
isn.rl,COFFEE_URL," url for :83- COFFEE")java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
}