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