Bug 1520342 - Fix autofill and autoFill inconsistency by standardizing on autofill (lowercase F). r=mak
authorDrew Willcoxon <adw@mozilla.com>
Wed, 16 Jan 2019 15:50:30 +0000
changeset 514092 af8ebdf790ba6b0fc721eed61c90e43bf7898e2d
parent 514091 8de26a67ac5c1c9e2945ef465db4dc9597ad4154
child 514093 a643bdc1b7a48ab27192c0fb6b5411319c9b2eaf
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1520342
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1520342 - Fix autofill and autoFill inconsistency by standardizing on autofill (lowercase F). r=mak Differential Revision: https://phabricator.services.mozilla.com/D16624
browser/components/urlbar/UrlbarController.jsm
browser/components/urlbar/UrlbarUtils.jsm
browser/components/urlbar/tests/unit/test_QueryContext.js
browser/components/urlbar/tests/unit/test_UrlbarController_unit.js
--- a/browser/components/urlbar/UrlbarController.jsm
+++ b/browser/components/urlbar/UrlbarController.jsm
@@ -87,17 +87,17 @@ class UrlbarController {
    */
   async startQuery(queryContext) {
     // Cancel any running query.
     if (this._lastQueryContext) {
       this.cancelQuery(this._lastQueryContext);
     }
     this._lastQueryContext = queryContext;
 
-    queryContext.autoFill = UrlbarPrefs.get("autoFill");
+    queryContext.autofill = UrlbarPrefs.get("autoFill");
 
     queryContext.lastTelemetryResultCount = 0;
     TelemetryStopwatch.start(TELEMETRY_1ST_RESULT, queryContext);
     TelemetryStopwatch.start(TELEMETRY_6_FIRST_RESULTS, queryContext);
 
     this._notify("onQueryStarted", queryContext);
     await this.manager.startQuery(queryContext, this);
     this._notify("onQueryFinished", queryContext);
@@ -195,17 +195,17 @@ class UrlbarController {
         event.preventDefault();
         break;
       case KeyEvent.DOM_VK_RETURN:
         if (isMac &&
             event.metaKey) {
           // Prevent beep on Mac.
           event.preventDefault();
         }
-        // TODO: We may have an autoFill entry, so we should use that instead.
+        // TODO: We may have an autofill entry, so we should use that instead.
         // TODO: We should have an input bufferrer so that we can use search results
         // if appropriate.
         this.input.handleCommand(event);
         break;
       case KeyEvent.DOM_VK_TAB:
         if (this.view.isOpen) {
           this.view.selectNextItem({ reverse: event.shiftKey });
           event.preventDefault();
--- a/browser/components/urlbar/UrlbarUtils.jsm
+++ b/browser/components/urlbar/UrlbarUtils.jsm
@@ -247,17 +247,17 @@ class QueryContext {
    *   in the case of the user opening the popup via the mouse.
    * @param {number} options.lastKey
    *   The last key the user entered (as a key code). Could be null if the search
    *   was started via the mouse.
    * @param {boolean} options.isPrivate
    *   Set to true if this query was started from a private browsing window.
    * @param {number} options.maxResults
    *   The maximum number of results that will be displayed for this query.
-   * @param {boolean} [options.autoFill]
+   * @param {boolean} [options.autofill]
    *   Whether or not to include autofill results. Optional, as this is normally
    *   set by the UrlbarController.
    */
   constructor(options = {}) {
     this._checkRequiredOptions(options, [
       "searchString",
       "lastKey",
       "maxResults",
@@ -273,17 +273,17 @@ class QueryContext {
       throw new Error(`Invalid providers list`);
     }
 
     if (options.sources &&
         (!Array.isArray(options.sources) || !options.sources.length)) {
       throw new Error(`Invalid sources list`);
     }
 
-    this.autoFill = !!options.autoFill;
+    this.autofill = !!options.autofill;
   }
 
   /**
    * Checks the required options, saving them as it goes.
    *
    * @param {object} options The options object to check.
    * @param {array} optionNames The names of the options to check for.
    * @throws {Error} Throws if there is a missing option.
--- a/browser/components/urlbar/tests/unit/test_QueryContext.js
+++ b/browser/components/urlbar/tests/unit/test_QueryContext.js
@@ -29,22 +29,22 @@ add_task(function test_constructor() {
   }), /Missing or empty isPrivate provided to QueryContext/,
     "Should throw with a missing isPrivate parameter");
 
   let qc = new QueryContext({
     searchString: "foo",
     lastKey: "b",
     maxResults: 1,
     isPrivate: true,
-    autoFill: false,
+    autofill: false,
   });
 
   Assert.equal(qc.searchString, "foo",
     "Should have saved the correct value for searchString");
   Assert.equal(qc.lastKey, "b",
     "Should have saved the correct value for lastKey");
   Assert.equal(qc.maxResults, 1,
     "Should have saved the correct value for maxResults");
   Assert.strictEqual(qc.isPrivate, true,
     "Should have saved the correct value for isPrivate");
-  Assert.strictEqual(qc.autoFill, false,
-    "Should have saved the correct value for autoFill");
+  Assert.strictEqual(qc.autofill, false,
+    "Should have saved the correct value for autofill");
 });
--- a/browser/components/urlbar/tests/unit/test_UrlbarController_unit.js
+++ b/browser/components/urlbar/tests/unit/test_UrlbarController_unit.js
@@ -133,42 +133,42 @@ add_task(function test_handle_query_star
   controller.startQuery(context);
 
   Assert.equal(fPM.startQuery.callCount, 1,
     "Should have called startQuery once");
   Assert.equal(fPM.startQuery.args[0].length, 2,
     "Should have called startQuery with two arguments");
 
   assertContextMatches(fPM.startQuery.args[0][0], {
-    autoFill: true,
+    autofill: true,
   });
   Assert.equal(fPM.startQuery.args[0][1], controller,
     "Should have passed the controller as the second argument");
 
 
   Assert.equal(generalListener.onQueryStarted.callCount, 1,
     "Should have called onQueryStarted for the listener");
   Assert.deepEqual(generalListener.onQueryStarted.args[0], [context],
     "Should have called onQueryStarted with the context");
 
   sandbox.resetHistory();
 });
 
-add_task(function test_handle_query_starts_search_sets_autoFill() {
+add_task(function test_handle_query_starts_search_sets_autofill() {
   Services.prefs.setBoolPref("browser.urlbar.autoFill", false);
 
   controller.startQuery(createContext());
 
   Assert.equal(fPM.startQuery.callCount, 1,
     "Should have called startQuery once");
   Assert.equal(fPM.startQuery.args[0].length, 2,
     "Should have called startQuery with two arguments");
 
   assertContextMatches(fPM.startQuery.args[0][0], {
-    autoFill: false,
+    autofill: false,
   });
   Assert.equal(fPM.startQuery.args[0][1], controller,
     "Should have passed the controller as the second argument");
 
   sandbox.resetHistory();
 
   Services.prefs.clearUserPref("browser.urlbar.autoFill");
 });