From a9e6a477eb6142c1d2b4497b91f87f9b91ef5705 Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Fri, 29 Apr 2016 12:10:34 -0400 Subject: [PATCH] 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 --- .../browser_misused_characters_in_strings.js | 4 ++++ services/sync/locales/en-US/sync.properties | 2 +- .../test/xpcshell/test_csp_validator.js | 24 +++++++++---------- ...st_ext_manifest_content_security_policy.js | 2 +- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/browser/base/content/test/general/browser_misused_characters_in_strings.js b/browser/base/content/test/general/browser_misused_characters_in_strings.js index 37753688bee6d..2b522778eeaf5 100644 --- a/browser/base/content/test/general/browser_misused_characters_in_strings.js +++ b/browser/base/content/test/general/browser_misused_characters_in_strings.js @@ -108,6 +108,10 @@ let gWhitelist = [{ file: "netErrorApp.dtd", key: "securityOverride.warningContent", type: "single-quote" + }, { + file: "sync.properties", + key: "client.name2", + type: "apostrophe" } ]; diff --git a/services/sync/locales/en-US/sync.properties b/services/sync/locales/en-US/sync.properties index 3d83ac94488df..23b71916c830a 100644 --- a/services/sync/locales/en-US/sync.properties +++ b/services/sync/locales/en-US/sync.properties @@ -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$S’s %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 diff --git a/toolkit/components/extensions/test/xpcshell/test_csp_validator.js b/toolkit/components/extensions/test/xpcshell/test_csp_validator.js index 2e6f048557e33..59a7322bc3c92 100644 --- a/toolkit/components/extensions/test/xpcshell/test_csp_validator.js +++ b/toolkit/components/extensions/test/xpcshell/test_csp_validator.js @@ -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`); } }); diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_manifest_content_security_policy.js b/toolkit/components/extensions/test/xpcshell/test_ext_manifest_content_security_policy.js index 84fb6770e0ddd..f65c4e33f4d1d 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_manifest_content_security_policy.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_manifest_content_security_policy.js @@ -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,