icecat: add release icecat-140.7.0-1gnu1 for ecne
This commit is contained in:
parent
7d0f5dab3b
commit
30225f2e73
156 changed files with 9131 additions and 4525 deletions
|
|
@ -9,7 +9,10 @@ let tempFile = new FileUtils.File(PathUtils.tempDir);
|
|||
const TEST_LOCAL_FILE_NAME = "hello.txt";
|
||||
tempFile.append(TEST_LOCAL_FILE_NAME);
|
||||
|
||||
const gL10n = new Localization(["toolkit/global/browser-utils.ftl"], true);
|
||||
const gL10n = new Localization(
|
||||
["toolkit/global/browser-utils.ftl", "toolkit/downloads/downloadUtils.ftl"],
|
||||
true
|
||||
);
|
||||
const DATA_URL_EXPECTED_STRING = gL10n.formatValueSync(
|
||||
"browser-utils-url-data"
|
||||
);
|
||||
|
|
@ -19,6 +22,10 @@ const EXTENSION_URL_EXPECTED_STRING = gL10n.formatValueSync(
|
|||
{ extension: EXTENSION_NAME }
|
||||
);
|
||||
|
||||
const FILE_URL_EXPECTED_STRING = gL10n.formatValueSync(
|
||||
"download-utils-done-file-scheme"
|
||||
);
|
||||
|
||||
const { AddonTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/AddonTestUtils.sys.mjs"
|
||||
);
|
||||
|
|
@ -88,7 +95,7 @@ const HTTP_TESTS = [
|
|||
output: "www.co.uk",
|
||||
},
|
||||
|
||||
// Other sudomains should be kept:
|
||||
// Other subdomains should be kept:
|
||||
{
|
||||
input: "https://webmail.example.co.uk",
|
||||
output: "webmail.example.co.uk",
|
||||
|
|
@ -158,6 +165,15 @@ const TESTS = [
|
|||
input: "data:text/html,42",
|
||||
output: DATA_URL_EXPECTED_STRING,
|
||||
},
|
||||
|
||||
{
|
||||
input: `moz-icon:${Services.io.newFileURI(tempFile).spec}`,
|
||||
output: tempFile.leafName,
|
||||
},
|
||||
{
|
||||
input: "moz-icon://.extension?size=16",
|
||||
output: "moz-icon://.extension?size=16",
|
||||
},
|
||||
];
|
||||
|
||||
add_setup(async () => {
|
||||
|
|
@ -220,7 +236,9 @@ const { BrowserUtils } = ChromeUtils.importESModule(
|
|||
add_task(async function test_checkStringFormatting() {
|
||||
for (let { input, output } of TESTS) {
|
||||
Assert.equal(
|
||||
BrowserUtils.formatURIStringForDisplay(input),
|
||||
BrowserUtils.formatURIStringForDisplay(input, {
|
||||
showFilenameForLocalURIs: true,
|
||||
}),
|
||||
output,
|
||||
`String ${input} formatted for output should match`
|
||||
);
|
||||
|
|
@ -231,13 +249,56 @@ add_task(async function test_checkURIFormatting() {
|
|||
for (let { input, output } of TESTS) {
|
||||
let uri = Services.io.newURI(input);
|
||||
Assert.equal(
|
||||
BrowserUtils.formatURIForDisplay(uri),
|
||||
BrowserUtils.formatURIForDisplay(uri, {
|
||||
showFilenameForLocalURIs: true,
|
||||
}),
|
||||
output,
|
||||
`URI ${input} formatted for output should match`
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
add_task(async function test_checkOnlyBaseDomain() {
|
||||
for (let { input, output } of [
|
||||
{ input: "https://subdomain.example.com/", output: "example.com" },
|
||||
{
|
||||
input: "http://www.city.mikasa.hokkaido.jp/",
|
||||
output: "city.mikasa.hokkaido.jp",
|
||||
},
|
||||
{ input: "https://www.example.co.uk/", output: "example.co.uk" },
|
||||
{
|
||||
input: "mailto:example@subdomain.example.com",
|
||||
output: "mailto:example@subdomain.example.com",
|
||||
},
|
||||
]) {
|
||||
let uri = Services.io.newURI(input);
|
||||
Assert.equal(
|
||||
BrowserUtils.formatURIForDisplay(uri, { onlyBaseDomain: true }),
|
||||
output,
|
||||
`URI ${input} formatted for output should match`
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
add_task(async function test_checkLocalFileFormatting() {
|
||||
for (let { input } of TESTS) {
|
||||
let uri = Services.io.newURI(input);
|
||||
if (
|
||||
["file", "chrome", "moz-icon", "resource", "jar"].includes(uri.scheme)
|
||||
) {
|
||||
Assert.equal(
|
||||
BrowserUtils.formatURIForDisplay(uri, {
|
||||
showFilenameForLocalURIs: false,
|
||||
}),
|
||||
uri.scheme == "file"
|
||||
? FILE_URL_EXPECTED_STRING
|
||||
: `${uri.scheme} resource`,
|
||||
`URI ${input} formatted for output should match`
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
add_task(async function test_checkViewSourceFormatting() {
|
||||
for (let { input, output } of HTTP_TESTS) {
|
||||
Assert.equal(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue