Bug 1376642 - (Part 2) Replace "profile" with "address" in formautofill file content. r=lchang draft
authorScott Wu <scottcwwu@gmail.com>
Wed, 26 Jul 2017 13:59:50 +0800
changeset 615781 0148ac028128b72a8b821d3bbb7f7be903b7aa68
parent 615612 749283b5b0a74dcc31d8bb2a0efed1751fa33f23
child 639272 315ba48276daa83f81a79764cab1557204275542
push id70466
push userbmo:scwwu@mozilla.com
push dateWed, 26 Jul 2017 09:32:38 +0000
reviewerslchang
bugs1376642
milestone56.0a1
Bug 1376642 - (Part 2) Replace "profile" with "address" in formautofill file content. r=lchang MozReview-Commit-ID: CJF7HpGjZaQ
browser/extensions/formautofill/FormAutofillPreferences.jsm
browser/extensions/formautofill/FormAutofillUtils.jsm
browser/extensions/formautofill/content/editAddress.js
browser/extensions/formautofill/content/editAddress.xhtml
browser/extensions/formautofill/content/manageAddresses.css
browser/extensions/formautofill/content/manageAddresses.js
browser/extensions/formautofill/content/manageAddresses.xhtml
browser/extensions/formautofill/locale/en-US/formautofill.properties
browser/extensions/formautofill/test/browser/browser.ini
browser/extensions/formautofill/test/browser/browser_editAddressDialog.js
browser/extensions/formautofill/test/browser/browser_manageAddressesDialog.js
browser/extensions/formautofill/test/browser/browser_privacyPreferences.js
browser/extensions/formautofill/test/browser/head.js
--- a/browser/extensions/formautofill/FormAutofillPreferences.jsm
+++ b/browser/extensions/formautofill/FormAutofillPreferences.jsm
@@ -10,17 +10,17 @@
 
 this.EXPORTED_SYMBOLS = ["FormAutofillPreferences"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 // Add addresses enabled flag in telemetry environment for recording the number of
 // users who disable/enable the address autofill feature.
 const PREF_AUTOFILL_ENABLED = "extensions.formautofill.addresses.enabled";
 const BUNDLE_URI = "chrome://formautofill/locale/formautofill.properties";
-const MANAGE_PROFILES_URL = "chrome://formautofill/content/manageProfiles.xhtml";
+const MANAGE_ADDRESSES_URL = "chrome://formautofill/content/manageAddresses.xhtml";
 const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://formautofill/FormAutofillUtils.jsm");
 
 this.log = null;
 FormAutofillUtils.defineLazyLogGetter(this, this.EXPORTED_SYMBOLS[0]);
@@ -63,76 +63,76 @@ FormAutofillPreferences.prototype = {
 
   /**
    * Create Form Autofill preference group
    *
    * @param  {XULDocument} document
    */
   createPreferenceGroup(document) {
     let formAutofillGroup;
-    let profileAutofill = document.createElementNS(XUL_NS, "hbox");
-    let profileAutofillCheckbox = document.createElementNS(XUL_NS, "checkbox");
+    let addressAutofill = document.createElementNS(XUL_NS, "hbox");
+    let addressAutofillCheckbox = document.createElementNS(XUL_NS, "checkbox");
     let spacer = document.createElementNS(XUL_NS, "spacer");
-    let savedProfilesBtn = document.createElementNS(XUL_NS, "button");
+    let savedAddressesBtn = document.createElementNS(XUL_NS, "button");
 
     if (this.useOldOrganization) {
       let caption = document.createElementNS(XUL_NS, "caption");
       let captionLabel = document.createElementNS(XUL_NS, "label");
 
       formAutofillGroup = document.createElementNS(XUL_NS, "groupbox");
       formAutofillGroup.hidden = document.location.href != "about:preferences#privacy";
       // Use .setAttribute because HTMLElement.dataset is not available on XUL elements
       formAutofillGroup.setAttribute("data-category", "panePrivacy");
       formAutofillGroup.appendChild(caption);
       caption.appendChild(captionLabel);
       captionLabel.textContent = this.bundle.GetStringFromName("preferenceGroupTitle");
     } else {
       formAutofillGroup = document.createElementNS(XUL_NS, "vbox");
-      savedProfilesBtn.className = "accessory-button";
+      savedAddressesBtn.className = "accessory-button";
     }
 
     this.refs = {
       formAutofillGroup,
-      profileAutofillCheckbox,
-      savedProfilesBtn,
+      addressAutofillCheckbox,
+      savedAddressesBtn,
     };
 
     formAutofillGroup.id = "formAutofillGroup";
-    profileAutofill.id = "profileAutofill";
-    savedProfilesBtn.setAttribute("label", this.bundle.GetStringFromName("savedProfiles"));
-    profileAutofillCheckbox.setAttribute("label", this.bundle.GetStringFromName("enableProfileAutofill"));
+    addressAutofill.id = "addressAutofill";
+    savedAddressesBtn.setAttribute("label", this.bundle.GetStringFromName("savedAddresses"));
+    addressAutofillCheckbox.setAttribute("label", this.bundle.GetStringFromName("enableAddressAutofill"));
 
     // Manually set the checked state
     if (this.isAutofillEnabled) {
-      profileAutofillCheckbox.setAttribute("checked", true);
+      addressAutofillCheckbox.setAttribute("checked", true);
     }
 
     spacer.flex = 1;
 
-    formAutofillGroup.appendChild(profileAutofill);
-    profileAutofill.appendChild(profileAutofillCheckbox);
-    profileAutofill.appendChild(spacer);
-    profileAutofill.appendChild(savedProfilesBtn);
+    formAutofillGroup.appendChild(addressAutofill);
+    addressAutofill.appendChild(addressAutofillCheckbox);
+    addressAutofill.appendChild(spacer);
+    addressAutofill.appendChild(savedAddressesBtn);
   },
 
   /**
    * Handle events
    *
    * @param  {DOMEvent} event
    */
   handleEvent(event) {
     switch (event.type) {
       case "command": {
         let target = event.target;
 
-        if (target == this.refs.profileAutofillCheckbox) {
+        if (target == this.refs.addressAutofillCheckbox) {
           // Set preference directly instead of relying on <Preference>
           Services.prefs.setBoolPref(PREF_AUTOFILL_ENABLED, target.checked);
-        } else if (target == this.refs.savedProfilesBtn) {
-          target.ownerGlobal.gSubDialog.open(MANAGE_PROFILES_URL);
+        } else if (target == this.refs.savedAddressesBtn) {
+          target.ownerGlobal.gSubDialog.open(MANAGE_ADDRESSES_URL);
         }
         break;
       }
     }
   },
 
   /**
    * Attach event listener
--- a/browser/extensions/formautofill/FormAutofillUtils.jsm
+++ b/browser/extensions/formautofill/FormAutofillUtils.jsm
@@ -198,39 +198,39 @@ this.FormAutofillUtils = {
     let scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
                          .getService(Ci.mozIJSSubScriptLoader);
     scriptLoader.loadSubScript(url, sandbox, "utf-8");
     return sandbox;
   },
 
   /**
    * Find the option element from select element.
-   * 1. Try to find the locale using the country from profile.
+   * 1. Try to find the locale using the country from address.
    * 2. First pass try to find exact match.
-   * 3. Second pass try to identify values from profile value and options,
+   * 3. Second pass try to identify values from address value and options,
    *    and look for a match.
    * @param   {DOMElement} selectEl
-   * @param   {object} profile
+   * @param   {object} address
    * @param   {string} fieldName
    * @returns {DOMElement}
    */
-  findSelectOption(selectEl, profile, fieldName) {
-    let value = profile[fieldName];
+  findSelectOption(selectEl, address, fieldName) {
+    let value = address[fieldName];
     if (!value) {
       return null;
     }
 
     // Load the addressData if needed
     if (!this._addressDataLoaded) {
       Object.assign(this, this.loadDataFromScript(ADDRESS_REFERENCES));
       this._addressDataLoaded = true;
     }
 
     // Set dataset to "data/US" as fallback
-    let dataset = this.addressData[`data/${profile.country}`] ||
+    let dataset = this.addressData[`data/${address.country}`] ||
                   this.addressData["data/US"];
     let collator = new Intl.Collator(dataset.lang, {sensitivity: "base", ignorePunctuation: true});
 
     for (let option of selectEl.options) {
       if (this.strCompare(value, option.value, collator) ||
           this.strCompare(value, option.text, collator)) {
         return option;
       }
@@ -242,17 +242,17 @@ this.FormAutofillUtils = {
       }
       if (!Array.isArray(dataset.sub_names)) {
         dataset.sub_names = dataset.sub_names.split("~");
       }
       let keys = dataset.sub_keys;
       let names = dataset.sub_names;
       let identifiedValue = this.identifyValue(keys, names, value, collator);
 
-      // No point going any further if we cannot identify value from profile
+      // No point going any further if we cannot identify value from address
       if (identifiedValue === undefined) {
         return null;
       }
 
       // Go through options one by one to find a match.
       // Also check if any option contain the address-level1 key.
       let pattern = new RegExp(`\\b${identifiedValue}\\b`, "i");
       for (let option of selectEl.options) {
--- a/browser/extensions/formautofill/content/editAddress.js
+++ b/browser/extensions/formautofill/content/editAddress.js
@@ -72,16 +72,17 @@ EditDialog.prototype = {
    *
    * @param  {DOMEvent} event
    */
   handleEvent(event) {
     switch (event.type) {
       case "DOMContentLoaded": {
         this.init();
         if (this._address) {
+          document.title = "Edit Address";
           this.loadInitialValues(this._address);
         }
         break;
       }
       case "click": {
         this.handleClick(event);
         break;
       }
--- a/browser/extensions/formautofill/content/editAddress.xhtml
+++ b/browser/extensions/formautofill/content/editAddress.xhtml
@@ -1,19 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 <!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-  <title>Profile Autofill - Edit Profile</title>
-  <link rel="stylesheet" href="chrome://formautofill-shared/skin/editProfile.css" />
-  <link rel="stylesheet" href="chrome://formautofill/skin/editProfile.css" />
-  <script src="chrome://formautofill/content/editProfile.js"></script>
+  <title>Add New Address</title>
+  <link rel="stylesheet" href="chrome://formautofill-shared/skin/editAddress.css" />
+  <link rel="stylesheet" href="chrome://formautofill/skin/editAddress.css" />
+  <script src="chrome://formautofill/content/editAddress.js"></script>
 </head>
 <body>
   <form autocomplete="off">
     <label id="given-name-container">
       <span>First Name</span>
       <input id="given-name" type="text"/>
     </label>
     <label id="additional-name-container">
--- a/browser/extensions/formautofill/content/manageAddresses.css
+++ b/browser/extensions/formautofill/content/manageAddresses.css
@@ -27,25 +27,25 @@ fieldset > legend {
   border-radius: 2px 2px 0 0;
   -moz-user-select: none;
 }
 
 option:nth-child(even) {
   background-color: -moz-oddtreerow;
 }
 
-#profiles {
+#addresses {
   font-size: 0.85em;
   width: 100%;
   height: 16.6em;
   border-top: none;
   border-radius: 0 0 2px 2px;
 }
 
-#profiles > option {
+#addresses > option {
   padding-inline-start: 0.7em;
 }
 
 #controls-container {
   flex: 0 1 100%;
   justify-content: end;
   font-size: 0.9em;
   margin-top: 1em;
--- a/browser/extensions/formautofill/content/manageAddresses.js
+++ b/browser/extensions/formautofill/content/manageAddresses.js
@@ -1,30 +1,30 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-const EDIT_PROFILE_URL = "chrome://formautofill/content/editProfile.xhtml";
+const EDIT_ADDRESS_URL = "chrome://formautofill/content/editAddress.xhtml";
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://formautofill/FormAutofillUtils.jsm");
 
 this.log = null;
-FormAutofillUtils.defineLazyLogGetter(this, "manageProfiles");
+FormAutofillUtils.defineLazyLogGetter(this, "manageAddresses");
 
-function ManageProfileDialog() {
+function ManageAddressDialog() {
   this.prefWin = window.opener;
   window.addEventListener("DOMContentLoaded", this, {once: true});
 }
 
-ManageProfileDialog.prototype = {
+ManageAddressDialog.prototype = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, Ci.nsIObserver]),
 
   _elements: {},
 
   /**
    * Count the number of "formautofill-storage-changed" events epected to
    * receive to prevent repeatedly loading addresses.
    * @type {number}
@@ -37,17 +37,17 @@ ManageProfileDialog.prototype = {
    * @returns {array<DOMElement>}
    */
   get _selectedOptions() {
     return Array.from(this._elements.addresses.selectedOptions);
   },
 
   init() {
     this._elements = {
-      addresses: document.getElementById("profiles"),
+      addresses: document.getElementById("addresses"),
       controlsContainer: document.getElementById("controls-container"),
       remove: document.getElementById("remove"),
       add: document.getElementById("add"),
       edit: document.getElementById("edit"),
     };
     this.attachEventListeners();
   },
 
@@ -180,17 +180,17 @@ ManageProfileDialog.prototype = {
   },
 
   /**
    * Open the edit address dialog to create/edit an address.
    *
    * @param  {object} address [optional]
    */
   openEditDialog(address) {
-    this.prefWin.gSubDialog.open(EDIT_PROFILE_URL, null, address);
+    this.prefWin.gSubDialog.open(EDIT_ADDRESS_URL, null, address);
   },
 
   /**
    * Enable/disable the Edit and Remove buttons based on number of selected
    * options.
    *
    * @param  {number} selectedCount
    */
@@ -297,9 +297,9 @@ ManageProfileDialog.prototype = {
     window.removeEventListener("keypress", this);
     this._elements.addresses.removeEventListener("change", this);
     this._elements.addresses.removeEventListener("click", this);
     this._elements.controlsContainer.removeEventListener("click", this);
     Services.obs.removeObserver(this, "formautofill-storage-changed");
   },
 };
 
-new ManageProfileDialog();
+new ManageAddressDialog();
--- a/browser/extensions/formautofill/content/manageAddresses.xhtml
+++ b/browser/extensions/formautofill/content/manageAddresses.xhtml
@@ -1,29 +1,29 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 <!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-  <title>Form Autofill - Manage Addresses</title>
+  <title>Saved Addresses</title>
   <link rel="stylesheet" href="chrome://global/skin/in-content/common.css" />
-  <link rel="stylesheet" href="chrome://formautofill/content/manageProfiles.css" />
-  <script src="chrome://formautofill/content/manageProfiles.js"></script>
+  <link rel="stylesheet" href="chrome://formautofill/content/manageAddresses.css" />
+  <script src="chrome://formautofill/content/manageAddresses.js"></script>
 </head>
 <body>
   <p style="padding-left: 30px; background: url(chrome://browser/skin/warning.svg) no-repeat left center">
     Autofill of addresses is only ready for testing with United States addresses on &lt;input&gt;s and some &lt;select&gt; elements.
     Improvements to form field type detection are in progress.
     <a href="https://luke-chang.github.io/autofill-demo/basic.html" target="_blank">Demo page</a>
   </p>
   <fieldset>
     <legend>Addresses</legend>
-    <select id="profiles" size="9" multiple="multiple"/>
+    <select id="addresses" size="9" multiple="multiple"/>
   </fieldset>
   <div id="controls-container">
     <button id="remove" disabled="disabled">Remove</button>
-    <button id="add">Add</button>
-    <button id="edit" disabled="disabled">Edit</button>
+    <button id="add">Add…</button>
+    <button id="edit" disabled="disabled">Edit…</button>
   </div>
 </body>
 </html>
--- a/browser/extensions/formautofill/locale/en-US/formautofill.properties
+++ b/browser/extensions/formautofill/locale/en-US/formautofill.properties
@@ -1,15 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 preferenceGroupTitle = Form Autofill
-enableProfileAutofill = Enable Profile Autofill
-savedProfiles = Saved Profiles…
+enableAddressAutofill = Autofill addresses
+savedAddresses = Saved Addresses…
 saveAddressesMessage = Firefox now saves addresses so you can fill out forms faster.
 viewAutofillOptionsLink = View Form Autofill Options
 changeAutofillOptions = Change Form Autofill Options
 viewAutofillOptionsLinkOSX = View Form Autofill Preferences
 changeAutofillOptionsOSX = Change Form Autofill Preferences
 updateAddressMessage = Would you like to update your address with this new information?
 createAddressLabel = Create New Address
 updateAddressLabel = Update Address
--- a/browser/extensions/formautofill/test/browser/browser.ini
+++ b/browser/extensions/formautofill/test/browser/browser.ini
@@ -1,14 +1,14 @@
 [DEFAULT]
 head = head.js
 
 support-files =
   ../fixtures/autocomplete_basic.html
 
 [browser_autocomplete_footer.js]
 [browser_check_installed.js]
-[browser_editProfileDialog.js]
+[browser_editAddressDialog.js]
 [browser_first_time_use_doorhanger.js]
 [browser_privacyPreferences.js]
-[browser_manageProfilesDialog.js]
+[browser_manageAddressesDialog.js]
 [browser_submission_in_private_mode.js]
 [browser_update_doorhanger.js]
--- a/browser/extensions/formautofill/test/browser/browser_editAddressDialog.js
+++ b/browser/extensions/formautofill/test/browser/browser_editAddressDialog.js
@@ -1,42 +1,42 @@
 "use strict";
 
-add_task(async function test_cancelEditProfileDialog() {
+add_task(async function test_cancelEditAddressDialog() {
   await new Promise(resolve => {
-    let win = window.openDialog(EDIT_PROFILE_DIALOG_URL, null, null, null);
+    let win = window.openDialog(EDIT_ADDRESS_DIALOG_URL, null, null, null);
     win.addEventListener("load", () => {
       win.addEventListener("unload", () => {
-        ok(true, "Edit profile dialog is closed");
+        ok(true, "Edit address dialog is closed");
         resolve();
       }, {once: true});
       win.document.querySelector("#cancel").click();
     }, {once: true});
   });
 });
 
-add_task(async function test_cancelEditProfileDialogWithESC() {
+add_task(async function test_cancelEditAddressDialogWithESC() {
   await new Promise(resolve => {
-    let win = window.openDialog(EDIT_PROFILE_DIALOG_URL);
+    let win = window.openDialog(EDIT_ADDRESS_DIALOG_URL);
     win.addEventListener("load", () => {
       win.addEventListener("unload", () => {
-        ok(true, "Edit profile dialog is closed with ESC key");
+        ok(true, "Edit address dialog is closed with ESC key");
         resolve();
       }, {once: true});
       EventUtils.synthesizeKey("VK_ESCAPE", {}, win);
     }, {once: true});
   });
 });
 
 add_task(async function test_saveAddress() {
   await new Promise(resolve => {
-    let win = window.openDialog(EDIT_PROFILE_DIALOG_URL, null, null, null);
+    let win = window.openDialog(EDIT_ADDRESS_DIALOG_URL, null, null, null);
     win.addEventListener("load", () => {
       win.addEventListener("unload", () => {
-        ok(true, "Edit profile dialog is closed");
+        ok(true, "Edit address dialog is closed");
         resolve();
       }, {once: true});
       EventUtils.synthesizeKey("VK_TAB", {}, win);
       EventUtils.synthesizeKey(TEST_ADDRESS_1["given-name"], {}, win);
       EventUtils.synthesizeKey("VK_TAB", {}, win);
       EventUtils.synthesizeKey(TEST_ADDRESS_1["additional-name"], {}, win);
       EventUtils.synthesizeKey("VK_TAB", {}, win);
       EventUtils.synthesizeKey(TEST_ADDRESS_1["family-name"], {}, win);
@@ -53,36 +53,36 @@ add_task(async function test_saveAddress
       EventUtils.synthesizeKey("VK_TAB", {}, win);
       EventUtils.synthesizeKey(TEST_ADDRESS_1.country, {}, win);
       EventUtils.synthesizeKey("VK_TAB", {}, win);
       EventUtils.synthesizeKey(TEST_ADDRESS_1.email, {}, win);
       EventUtils.synthesizeKey("VK_TAB", {}, win);
       EventUtils.synthesizeKey(TEST_ADDRESS_1.tel, {}, win);
       EventUtils.synthesizeKey("VK_TAB", {}, win);
       EventUtils.synthesizeKey("VK_TAB", {}, win);
-      info("saving profile");
+      info("saving address");
       EventUtils.synthesizeKey("VK_RETURN", {}, win);
     }, {once: true});
   });
   let addresses = await getAddresses();
 
   is(addresses.length, 1, "only one address is in storage");
   is(Object.keys(TEST_ADDRESS_1).length, 11, "Sanity check number of properties");
   for (let [fieldName, fieldValue] of Object.entries(TEST_ADDRESS_1)) {
     is(addresses[0][fieldName], fieldValue, "check " + fieldName);
   }
 });
 
-add_task(async function test_editProfile() {
+add_task(async function test_editAddress() {
   let addresses = await getAddresses();
   await new Promise(resolve => {
-    let win = window.openDialog(EDIT_PROFILE_DIALOG_URL, null, null, addresses[0]);
+    let win = window.openDialog(EDIT_ADDRESS_DIALOG_URL, null, null, addresses[0]);
     win.addEventListener("load", () => {
       win.addEventListener("unload", () => {
-        ok(true, "Edit profile dialog is closed");
+        ok(true, "Edit address dialog is closed");
         resolve();
       }, {once: true});
       EventUtils.synthesizeKey("VK_TAB", {}, win);
       EventUtils.synthesizeKey("test", {}, win);
       win.document.querySelector("#save").click();
     }, {once: true});
   });
   addresses = await getAddresses();
--- a/browser/extensions/formautofill/test/browser/browser_manageAddressesDialog.js
+++ b/browser/extensions/formautofill/test/browser/browser_manageAddressesDialog.js
@@ -1,12 +1,12 @@
 "use strict";
 
 const TEST_SELECTORS = {
-  selAddresses: "#profiles",
+  selAddresses: "#addresses",
   btnRemove: "#remove",
   btnAdd: "#add",
   btnEdit: "#edit",
 };
 
 const DIALOG_SIZE = "width=600,height=400";
 
 function waitForRecords() {
@@ -14,51 +14,51 @@ function waitForRecords() {
     Services.cpmm.addMessageListener("FormAutofill:Records", function getResult(result) {
       Services.cpmm.removeMessageListener("FormAutofill:Records", getResult);
       // Wait for the next tick for elements to get rendered.
       SimpleTest.executeSoon(resolve.bind(null, result.data));
     });
   });
 }
 
-add_task(async function test_manageProfilesInitialState() {
-  await BrowserTestUtils.withNewTab({gBrowser, url: MANAGE_PROFILES_DIALOG_URL}, async function(browser) {
+add_task(async function test_manageAddressesInitialState() {
+  await BrowserTestUtils.withNewTab({gBrowser, url: MANAGE_ADDRESSES_DIALOG_URL}, async function(browser) {
     await ContentTask.spawn(browser, TEST_SELECTORS, (args) => {
       let selAddresses = content.document.querySelector(args.selAddresses);
       let btnRemove = content.document.querySelector(args.btnRemove);
       let btnEdit = content.document.querySelector(args.btnEdit);
       let btnAdd = content.document.querySelector(args.btnAdd);
 
       is(selAddresses.length, 0, "No address");
       is(btnAdd.disabled, false, "Add button enabled");
       is(btnRemove.disabled, true, "Remove button disabled");
       is(btnEdit.disabled, true, "Edit button disabled");
     });
   });
 });
 
-add_task(async function test_cancelManageProfileDialogWithESC() {
+add_task(async function test_cancelManageAddressDialogWithESC() {
   await new Promise(resolve => {
-    let win = window.openDialog(MANAGE_PROFILES_DIALOG_URL);
+    let win = window.openDialog(MANAGE_ADDRESSES_DIALOG_URL);
     win.addEventListener("load", () => {
       win.addEventListener("unload", () => {
-        ok(true, "Manage profiles dialog is closed with ESC key");
+        ok(true, "Manage addresses dialog is closed with ESC key");
         resolve();
       }, {once: true});
       EventUtils.synthesizeKey("VK_ESCAPE", {}, win);
     }, {once: true});
   });
 });
 
-add_task(async function test_removingSingleAndMultipleProfiles() {
+add_task(async function test_removingSingleAndMultipleAddresses() {
   await saveAddress(TEST_ADDRESS_1);
   await saveAddress(TEST_ADDRESS_2);
   await saveAddress(TEST_ADDRESS_3);
 
-  let win = window.openDialog(MANAGE_PROFILES_DIALOG_URL, null, DIALOG_SIZE);
+  let win = window.openDialog(MANAGE_ADDRESSES_DIALOG_URL, null, DIALOG_SIZE);
   await waitForRecords();
 
   let selAddresses = win.document.querySelector(TEST_SELECTORS.selAddresses);
   let btnRemove = win.document.querySelector(TEST_SELECTORS.btnRemove);
   let btnEdit = win.document.querySelector(TEST_SELECTORS.btnEdit);
 
   is(selAddresses.length, 3, "Three addresses");
 
@@ -76,18 +76,18 @@ add_task(async function test_removingSin
 
   EventUtils.synthesizeMouseAtCenter(btnRemove, {}, win);
   await waitForRecords();
   is(selAddresses.length, 0, "All addresses are removed");
 
   win.close();
 });
 
-add_task(async function test_profilesDialogWatchesStorageChanges() {
-  let win = window.openDialog(MANAGE_PROFILES_DIALOG_URL, null, DIALOG_SIZE);
+add_task(async function test_addressesDialogWatchesStorageChanges() {
+  let win = window.openDialog(MANAGE_ADDRESSES_DIALOG_URL, null, DIALOG_SIZE);
   await waitForRecords();
 
   let selAddresses = win.document.querySelector(TEST_SELECTORS.selAddresses);
 
   await saveAddress(TEST_ADDRESS_1);
   let addresses = await waitForRecords();
   is(selAddresses.length, 1, "One address is shown");
 
--- a/browser/extensions/formautofill/test/browser/browser_privacyPreferences.js
+++ b/browser/extensions/formautofill/test/browser/browser_privacyPreferences.js
@@ -1,14 +1,14 @@
 "use strict";
 
 const PAGE_PREFS = "about:preferences";
 const PAGE_PRIVACY = PAGE_PREFS + "#privacy";
 const GROUP_AUTOFILL = "#passwordsGroup";
-const CHECKBOX_AUTOFILL = "#profileAutofill checkbox";
+const CHECKBOX_AUTOFILL = "#addressAutofill checkbox";
 const PREF_AUTOFILL_ENABLED = "extensions.formautofill.addresses.enabled";
 const TEST_SELECTORS = {
   group: GROUP_AUTOFILL,
   checkbox: CHECKBOX_AUTOFILL,
 };
 
 // Visibility of form autofill group should be hidden when opening
 // preferences page.
--- a/browser/extensions/formautofill/test/browser/head.js
+++ b/browser/extensions/formautofill/test/browser/head.js
@@ -1,17 +1,17 @@
-/* exported MANAGE_PROFILES_DIALOG_URL, EDIT_PROFILE_DIALOG_URL, BASE_URL,
+/* exported MANAGE_ADDRESSES_DIALOG_URL, EDIT_ADDRESS_DIALOG_URL, BASE_URL,
             TEST_ADDRESS_1, TEST_ADDRESS_2, TEST_ADDRESS_3,
             sleep, expectPopupOpen, openPopupOn, clickDoorhangerButton,
             getAddresses, saveAddress, removeAddresses */
 
 "use strict";
 
-const MANAGE_PROFILES_DIALOG_URL = "chrome://formautofill/content/manageProfiles.xhtml";
-const EDIT_PROFILE_DIALOG_URL = "chrome://formautofill/content/editProfile.xhtml";
+const MANAGE_ADDRESSES_DIALOG_URL = "chrome://formautofill/content/manageAddresses.xhtml";
+const EDIT_ADDRESS_DIALOG_URL = "chrome://formautofill/content/editAddress.xhtml";
 const BASE_URL = "http://mochi.test:8888/browser/browser/extensions/formautofill/test/browser/";
 
 const TEST_ADDRESS_1 = {
   "given-name": "John",
   "additional-name": "R.",
   "family-name": "Smith",
   organization: "World Wide Web Consortium",
   "street-address": "32 Vassar Street\nMIT Room 32-G524",