Bug 1268159 - followup, update some tests that got missed in the conversion from straight quotes to curly quotes and revert the Sync client name change until a follow-up bug can track down the deeper regression. r=me on a CLOSED TREE.

MozReview-Commit-ID: 13k7s3n7jz7
This commit is contained in:
Jared Wein 2016-04-29 12:10:34 -04:00
Родитель e889366796
Коммит a9e6a477eb
4 изменённых файлов: 18 добавлений и 14 удалений

Просмотреть файл

@ -108,6 +108,10 @@ let gWhitelist = [{
file: "netErrorApp.dtd",
key: "securityOverride.warningContent",
type: "single-quote"
}, {
file: "sync.properties",
key: "client.name2",
type: "apostrophe"
}
];

Просмотреть файл

@ -3,7 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# %1: the user name (Ed), %2: the app name (Firefox), %3: the operating system (Android)
client.name2 = %1$Ss %2$S on %3$S
client.name2 = %1$S's %2$S on %3$S
# %S is the date and time at which the last sync successfully completed
lastSync2.label = Last sync: %S

Просмотреть файл

@ -22,10 +22,10 @@ add_task(function* test_csp_validator() {
null);
checkPolicy("",
"Policy is missing a required 'script-src' directive");
"Policy is missing a required \u2018script-src\u2019 directive");
checkPolicy("object-src 'none';",
"Policy is missing a required 'script-src' directive");
"Policy is missing a required \u2018script-src\u2019 directive");
checkPolicy("default-src 'self'", null,
@ -39,25 +39,25 @@ add_task(function* test_csp_validator() {
checkPolicy("default-src 'self'; script-src http://example.com",
"'script-src' directive contains a forbidden http: protocol source",
"\u2018script-src\u2019 directive contains a forbidden http: protocol source",
"A valid default-src should not allow an invalid script-src directive");
checkPolicy("default-src 'self'; object-src http://example.com",
"'object-src' directive contains a forbidden http: protocol source",
"\u2018object-src\u2019 directive contains a forbidden http: protocol source",
"A valid default-src should not allow an invalid object-src directive");
checkPolicy("script-src 'self';",
"Policy is missing a required 'object-src' directive");
"Policy is missing a required \u2018object-src\u2019 directive");
checkPolicy("script-src 'none'; object-src 'none'",
"'script-src' must include the source 'self'");
"\u2018script-src\u2019 must include the source 'self'");
checkPolicy("script-src 'self'; object-src 'none';",
null);
checkPolicy("script-src 'self' 'unsafe-inline'; object-src 'self';",
"'script-src' directive contains a forbidden 'unsafe-inline' keyword");
"\u2018script-src\u2019 directive contains a forbidden 'unsafe-inline' keyword");
let directives = ["script-src", "object-src"];
@ -65,21 +65,21 @@ add_task(function* test_csp_validator() {
for (let [directive, other] of [directives, directives.slice().reverse()]) {
for (let src of ["https://*", "https://*.blogspot.com", "https://*"]) {
checkPolicy(`${directive} 'self' ${src}; ${other} 'self';`,
`https: wildcard sources in '${directive}' directives must include at least one non-generic sub-domain (e.g., *.example.com rather than *.com)`);
`https: wildcard sources in \u2018${directive}\u2019 directives must include at least one non-generic sub-domain (e.g., *.example.com rather than *.com)`);
}
checkPolicy(`${directive} 'self' https:; ${other} 'self';`,
`https: protocol requires a host in '${directive}' directives`);
`https: protocol requires a host in \u2018${directive}\u2019 directives`);
checkPolicy(`${directive} 'self' http://example.com; ${other} 'self';`,
`'${directive}' directive contains a forbidden http: protocol source`);
`\u2018${directive}\u2019 directive contains a forbidden http: protocol source`);
for (let protocol of ["http", "ftp", "meh"]) {
checkPolicy(`${directive} 'self' ${protocol}:; ${other} 'self';`,
`'${directive}' directive contains a forbidden ${protocol}: protocol source`);
`\u2018${directive}\u2019 directive contains a forbidden ${protocol}: protocol source`);
}
checkPolicy(`${directive} 'self' 'nonce-01234'; ${other} 'self';`,
`'${directive}' directive contains a forbidden 'nonce-*' keyword`);
`\u2018${directive}\u2019 directive contains a forbidden 'nonce-*' keyword`);
}
});

Просмотреть файл

@ -22,7 +22,7 @@ add_task(function* test_manifest_csp() {
equal(normalized.error, undefined, "Should not have an error");
Assert.deepEqual(normalized.errors,
["Error processing content_security_policy: SyntaxError: Policy is missing a required 'script-src' directive"],
["Error processing content_security_policy: SyntaxError: Policy is missing a required \u2018script-src\u2019 directive"],
"Should have the expected warning");
equal(normalized.value.content_security_policy, null,