Files
firefox/devtools/client/webconsole/test/browser_webconsole_abbreviate_source_url.js
T
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

24 lines
779 B
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that source URLs are abbreviated properly for display on the right-
// hand side of the Web Console.
"use strict";
function test() {
testAbbreviation("http://example.com/x.js", "x.js");
testAbbreviation("http://example.com/foo/bar/baz/boo.js", "boo.js");
testAbbreviation("http://example.com/foo/bar/", "bar");
testAbbreviation("http://example.com/foo.js?bar=1&baz=2", "foo.js");
testAbbreviation("http://example.com/foo/?bar=1&baz=2", "foo");
finishTest();
}
function testAbbreviation(aFullURL, aAbbreviatedURL) {
is(WebConsoleUtils.abbreviateSourceURL(aFullURL), aAbbreviatedURL, aFullURL +
" is abbreviated to " + aAbbreviatedURL);
}