From 348a37a7ec353b5d720d36e7c873eec449ee855b Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Wed, 13 Jul 2016 11:55:19 -0400 Subject: [PATCH] Bug 1268912 - Use unicode apostrophe for client.name2 in sync properties, working around issues with sync tests. r=markh MozReview-Commit-ID: 5XArwMUQwQF --HG-- extra : rebase_source : 99a8b6e1f7806bb6a37a613cbdd93626c6593378 --- .../general/browser_misused_characters_in_strings.js | 4 ---- services/sync/locales/en-US/sync.properties | 2 +- services/sync/tests/unit/head_helpers.js | 10 ++++++++++ 3 files changed, 11 insertions(+), 5 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 f62612df780c..9b3c598ffaf9 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 @@ -100,10 +100,6 @@ 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 23b71916c830..3d83ac94488d 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/services/sync/tests/unit/head_helpers.js b/services/sync/tests/unit/head_helpers.js index 3b09659b9760..dc3ec5a04042 100644 --- a/services/sync/tests/unit/head_helpers.js +++ b/services/sync/tests/unit/head_helpers.js @@ -4,6 +4,7 @@ Cu.import("resource://services-common/async.js"); Cu.import("resource://testing-common/services/common/utils.js"); Cu.import("resource://testing-common/PlacesTestUtils.jsm"); +Cu.import("resource://services-sync/util.js"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyGetter(this, 'SyncPingSchema', function() { @@ -390,3 +391,12 @@ function sync_engine_and_validate_telem(engine, allowErrorPings, onError) { } }); } + +// Avoid an issue where `client.name2` containing unicode characters causes +// a number of tests to fail, due to them assuming that we do not need to utf-8 +// encode or decode data sent through the mocked server (see bug 1268912). +Utils.getDefaultDeviceName = function() { + return "Test device name"; +}; + +