Files
tubestation/devtools/server/tests/unit/test_sourcemaps-04.js
J. Ryan Stinnett a3073e0420 Bug 912121 - Migrate major DevTools directories. rs=devtools
Move major DevTools files to new directories using the following steps:

hg mv browser/devtools devtools/client
hg mv toolkit/devtools/server devtools/server
hg mv toolkit/devtools devtools/shared

No other changes are made.
2015-09-21 12:02:24 -05:00

47 lines
1.4 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Check that absolute source map urls work.
*/
var gDebuggee;
var gClient;
var gThreadClient;
function run_test()
{
initTestDebuggerServer();
gDebuggee = addTestGlobal("test-source-map");
gClient = new DebuggerClient(DebuggerServer.connectPipe());
gClient.connect(function() {
attachTestTabAndResume(gClient, "test-source-map", function(aResponse, aTabClient, aThreadClient) {
gThreadClient = aThreadClient;
test_absolute_source_map();
});
});
do_test_pending();
}
function test_absolute_source_map()
{
gThreadClient.addOneTimeListener("newSource", function _onNewSource(aEvent, aPacket) {
do_check_eq(aEvent, "newSource");
do_check_eq(aPacket.type, "newSource");
do_check_true(!!aPacket.source);
do_check_true(aPacket.source.url.indexOf("sourcemapped.coffee") !== -1,
"The new source should be a coffee file.");
do_check_eq(aPacket.source.url.indexOf("sourcemapped.js"), -1,
"The new source should not be a js file.");
finishClient(gClient);
});
code = readFile("sourcemapped.js")
+ "\n//# sourceMappingURL=" + getFileUrl("source-map-data/sourcemapped.map");
Components.utils.evalInSandbox(code, gDebuggee, "1.8",
getFileUrl("sourcemapped.js"), 1);
}