Bug 1340651 - Update our misused characters test to check for instances of Firefox that should be using brandShortName. r?florian draft
authorJared Wein <jwein@mozilla.com>
Fri, 17 Feb 2017 16:40:40 -0500
changeset 486357 9a1200fe999f073ab323252a96600bde59b1d6f6
parent 481880 511093a0d82882d4b20f91b0287ad4b610c5225f
child 546230 9ca9b870b1a09f111a230fb2bc7d0f511387b505
push id45968
push userjwein@mozilla.com
push dateFri, 17 Feb 2017 21:41:09 +0000
reviewersflorian
bugs1340651
milestone54.0a1
Bug 1340651 - Update our misused characters test to check for instances of Firefox that should be using brandShortName. r?florian MozReview-Commit-ID: H3Jf9uMV8ro
browser/base/content/test/general/browser_misused_characters_in_strings.js
--- a/browser/base/content/test/general/browser_misused_characters_in_strings.js
+++ b/browser/base/content/test/general/browser_misused_characters_in_strings.js
@@ -99,16 +99,236 @@ let gWhitelist = [{
   }, {
     file: "pocket.properties",
     key: "tos",
     type: "double-quote"
   }, {
     file: "aboutNetworking.dtd",
     key: "aboutNetworking.logTutorial",
     type: "single-quote"
+  }, {
+    file: "accounts.properties",
+    key: "deviceConnectedTitle",
+    type: "brandShortName"
+  }, {
+    file: "accounts.properties",
+    key: "deviceDisconnectedNotification.body",
+    type: "brandShortName"
+  }, {
+    file: "appstrings.properties",
+    key: "connectionFailure",
+    type: "brandShortName"
+  }, {
+    file: "appstrings.properties",
+    key: "dnsNotFound",
+    type: "brandShortName"
+  }, {
+    file: "appstrings.properties",
+    key: "sslv3Used",
+    type: "brandShortName"
+  }, {
+    file: "appstrings.properties",
+    key: "fileNotFound",
+    type: "brandShortName"
+  }, {
+    file: "appstrings.properties",
+    key: "proxyResolveFailure",
+    type: "brandShortName"
+  }, {
+    file: "appstrings.properties",
+    key: "proxyConnectFailure",
+    type: "brandShortName"
+  }, {
+    file: "appstrings.properties",
+    key: "unknownSocketType",
+    type: "brandShortName"
+  }, {
+    file: "appstrings.properties",
+    key: "unknownProtocolFound",
+    type: "brandShortName"
+  }, {
+    file: "appstrings.properties",
+    key: "netOffline",
+    type: "brandShortName"
+  }, {
+    file: "appstrings.properties",
+    key: "deniedPortAccess",
+    type: "brandShortName"
+  }, {
+    file: "appstrings.properties",
+    key: "remoteXUL",
+    type: "brandShortName"
+  }, {
+    file: "appstrings.properties",
+    key: "redirectLoop",
+    type: "brandShortName"
+  }, {
+    file: "browser.properties",
+    key: "appMenuRemoteTabs.mobilePromo.android",
+    type: "brandShortName"
+  }, {
+    file: "browser.properties",
+    key: "appMenuRemoteTabs.mobilePromo.ios",
+    type: "brandShortName"
+  }, {
+    file: "browser.properties",
+    key: "appMenuRemoteTabs.mobilePromo.text2",
+    type: "brandShortName"
+  }, {
+    file: "errors.properties",
+    key: "error.sync.reason.serverMaintenance",
+    type: "brandShortName"
+  }, {
+    file: "markers.properties",
+    key: "marker.gcreason.description.NSJSCONTEXT_DESTROY",
+    type: "brandShortName"
+  }, {
+    file: "markers.properties",
+    key: "marker.gcreason.description.PERIODIC_FULL_GC",
+    type: "brandShortName"
+  }, {
+    file: "markers.properties",
+    key: "marker.gcreason.description.USER_INACTIVE",
+    type: "brandShortName"
+  }, {
+    file: "markers.properties",
+    key: "marker.gcreason.description.FINISH_LARGE_EVALUATE",
+    type: "brandShortName"
+  }, {
+    file: "markers.properties",
+    key: "marker.gcreason.description.DESTROY_RUNTIME",
+    type: "brandShortName"
+  }, {
+    file: "markers.properties",
+    key: "marker.gcreason.description.SHUTDOWN_CC",
+    type: "brandShortName"
+  }, {
+    file: "memory.properties",
+    key: "snapshot.io.filter",
+    type: "brandShortName"
+  }, {
+    file: "migration.properties",
+    key: "sourceNameFirefox",
+    type: "brandShortName"
+  }, {
+    file: "pocket.properties",
+    key: "signupfirefox",
+    type: "brandShortName"
+  }, {
+    file: "pocket.properties",
+    key: "tagline",
+    type: "brandShortName"
+  }, {
+    file: "pocket.properties",
+    key: "continueff",
+    type: "brandShortName"
+  }, {
+    file: "pocket.properties",
+    key: "signinfirefox",
+    type: "brandShortName"
+  }, {
+    file: "pocket.properties",
+    key: "taglinestory_one",
+    type: "brandShortName"
+  }, {
+    file: "responsive.properties",
+    key: "responsive.remoteOnly",
+    type: "brandShortName"
+  }, {
+    file: "webide.properties",
+    key: "error_runtimeVersionTooRecent",
+    type: "brandShortName"
+  }, {
+    file: "webide.properties",
+    key: "error_appProjectsLoadFailed",
+    type: "brandShortName"
+  }, {
+    file: "webide.properties",
+    key: "title_app",
+    type: "brandShortName"
+  }, {
+    file: "webide.properties",
+    key: "title_noApp",
+    type: "brandShortName"
+  }, {
+    file: "webide.properties",
+    key: "addons_simulator_label",
+    type: "brandShortName"
+  }, {
+    file: "aboutAccounts.dtd",
+    key: "aboutAccounts.badConfig.description",
+    type: "brandShortName"
+  }, {
+    file: "aboutHome.dtd",
+    key: "abouthome.defaultSnippet1.v1",
+    type: "brandShortName"
+  }, {
+    file: "aboutHome.dtd",
+    key: "abouthome.defaultSnippet2.v1",
+    type: "brandShortName"
+  }, {
+    file: "aboutPrivateBrowsing.dtd",
+    key: "aboutPrivateBrowsing.info.notsaved.before",
+    type: "brandShortName"
+  }, {
+    file: "aboutPrivateBrowsing.dtd",
+    key: "aboutPrivateBrowsing.info.saved.before",
+    type: "brandShortName"
+  }, {
+    file: "aboutPrivateBrowsing.dtd",
+    key: "trackingProtection.description2",
+    type: "brandShortName"
+  }, {
+    file: "browser.dtd",
+    key: "syncedTabs.sidebar.noclients.label",
+    type: "brandShortName"
+  }, {
+    file: "connection-screen.dtd",
+    key: "remoteHelp",
+    type: "brandShortName"
+  }, {
+    file: "sync.dtd",
+    key: "mobilePromo3.start",
+    type: "brandShortName"
+  }, {
+    file: "syncBrand.dtd",
+    key: "syncBrand.fullName.label",
+    type: "brandShortName"
+  }, {
+    file: "syncBrand.dtd",
+    key: "syncBrand.fxAccount.label",
+    type: "brandShortName"
+  }, {
+    file: "migration.dtd",
+    key: "importFromFirefox.label",
+    type: "brandShortName"
+  }, {
+    file: "main.dtd",
+    key: "separateProfileMode.label",
+    type: "brandShortName"
+  }, {
+    file: "aboutdebugging.dtd",
+    key: "aboutDebugging.fullTitle",
+    type: "brandShortName"
+  }, {
+    file: "performance.dtd",
+    key: "performanceUI.disabledRealTime.nonE10SBuild",
+    type: "brandShortName"
+  }, {
+    file: "performance.dtd",
+    key: "performanceUI.disabledRealTime.disabledE10S",
+    type: "brandShortName"
+  }, {
+    file: "toolbox.dtd",
+    key: "options.enableRemote.tooltip2",
+    type: "brandShortName"
+  }, {
+    file: "webide.dtd",
+    key: "windowTitle",
+    type: "brandShortName"
   }
 ];
 
 var moduleLocation = gTestPath.replace(/\/[^\/]*$/i, "/parsingTestHelpers.jsm");
 var {generateURIsFromDirTree} = Cu.import(moduleLocation, {});
 
 /**
  * Check if an error should be ignored due to matching one of the whitelist
@@ -163,16 +383,17 @@ function testForError(filepath, key, str
 }
 
 function testForErrors(filepath, key, str) {
   testForError(filepath, key, str, /\w'\w/, "apostrophe", "Strings with apostrophes should use foo\u2019s instead of foo's.");
   testForError(filepath, key, str, /\w\u2018\w/, "incorrect-apostrophe", "Strings with apostrophes should use foo\u2019s instead of foo\u2018s.");
   testForError(filepath, key, str, /'.+'/, "single-quote", "Single-quoted strings should use Unicode \u2018foo\u2019 instead of 'foo'.");
   testForError(filepath, key, str, /"/, "double-quote", "Double-quoted strings should use Unicode \u201cfoo\u201d instead of \"foo\".");
   testForError(filepath, key, str, /\.\.\./, "ellipsis", "Strings with an ellipsis should use the Unicode \u2026 character instead of three periods.");
+  testForError(filepath, key, str, /Firefox/, "brandShortName", "Strings with a brand should use brandShortName instead of hardcoding the value.");
 }
 
 function* getAllTheFiles(extension) {
   let appDirGreD = Services.dirsvc.get("GreD", Ci.nsIFile);
   let appDirXCurProcD = Services.dirsvc.get("XCurProcD", Ci.nsIFile);
   if (appDirGreD.contains(appDirXCurProcD)) {
     return yield generateURIsFromDirTree(appDirGreD, [extension]);
   }
@@ -228,9 +449,12 @@ add_task(function* checkAllTheDTDs() {
   // This support DTD file supplies a string with a newline to make sure
   // the regex in checkDTD works correctly for that case.
   let dtdLocation = gTestPath.replace(/\/[^\/]*$/i, "/bug1262648_string_with_newlines.dtd");
   yield checkDTD(dtdLocation);
 });
 
 add_task(function* ensureWhiteListIsEmpty() {
   is(gWhitelist.length, 0, "No remaining whitelist entries exist");
+  for (let entry of gWhitelist) {
+    info(`Remaining entry of ${entry.file} :: ${entry.key} :: ${entry.type}`);
+  }
 });