Backed out changeset 3c32d4e19a92 (bug 1582234) for ES Lint failrue on UnifiedComplete.jsm. CLOSED TREE
authorRazvan Maries <rmaries@mozilla.com>
Wed, 23 Oct 2019 19:05:28 +0300
changeset 498742 62d6bd13bb5638c06e6cc609b3df43587bfda675
parent 498741 6dffdf63221aa03f7c52e3aaf408b485ddcb6bbc
child 498743 e9c9a624d055b54cf65a5361f5261a2278ec6d3e
push id98654
push userrmaries@mozilla.com
push dateWed, 23 Oct 2019 16:06:09 +0000
treeherderautoland@62d6bd13bb56 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1582234
milestone72.0a1
backs out3c32d4e19a929a92e875e63e92d189e06cefc3ed
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
Backed out changeset 3c32d4e19a92 (bug 1582234) for ES Lint failrue on UnifiedComplete.jsm. CLOSED TREE
toolkit/components/places/UnifiedComplete.jsm
toolkit/components/places/tests/unifiedcomplete/autofill_tasks.js
--- a/toolkit/components/places/UnifiedComplete.jsm
+++ b/toolkit/components/places/UnifiedComplete.jsm
@@ -173,175 +173,148 @@ const SQL_AUTOFILL_WITH = `
     FROM frecency_stats
   )
 `;
 
 const SQL_AUTOFILL_FRECENCY_THRESHOLD = `(
   SELECT value FROM autofill_frecency_threshold
 )`;
 
-function originQuery({ select = "", where = "", having = "" }) {
+function originQuery(conditions = "") {
   return `${SQL_AUTOFILL_WITH}
           SELECT :query_type,
                  fixed_up_host || '/',
                  IFNULL(:prefix, prefix) || moz_origins.host || '/',
                  frecency,
                  bookmarked,
                  id
           FROM (
             SELECT host,
                    host AS fixed_up_host,
                    TOTAL(frecency) AS host_frecency,
                    (
                      SELECT TOTAL(foreign_count) > 0
                      FROM moz_places
                      WHERE moz_places.origin_id = moz_origins.id
                    ) AS bookmarked
-                   ${select}
             FROM moz_origins
             WHERE host BETWEEN :searchString AND :searchString || X'FFFF'
-                  ${where}
+                  ${conditions}
             GROUP BY host
             HAVING host_frecency >= ${SQL_AUTOFILL_FRECENCY_THRESHOLD}
-                   ${having}
+                   OR bookmarked
             UNION ALL
             SELECT host,
                    fixup_url(host) AS fixed_up_host,
                    TOTAL(frecency) AS host_frecency,
                    (
                      SELECT TOTAL(foreign_count) > 0
                      FROM moz_places
                      WHERE moz_places.origin_id = moz_origins.id
                    ) AS bookmarked
-                   ${select}
             FROM moz_origins
             WHERE host BETWEEN 'www.' || :searchString AND 'www.' || :searchString || X'FFFF'
-                  ${where}
+                  ${conditions}
             GROUP BY host
             HAVING host_frecency >= ${SQL_AUTOFILL_FRECENCY_THRESHOLD}
-                   ${having}
+                   OR bookmarked
           ) AS grouped_hosts
           JOIN moz_origins ON moz_origins.host = grouped_hosts.host
           ORDER BY frecency DESC, id DESC
           LIMIT 1 `;
 }
 
-const QUERY_ORIGIN_HISTORY_BOOKMARK = originQuery({
-  having: `OR bookmarked`,
-});
-
-const QUERY_ORIGIN_PREFIX_HISTORY_BOOKMARK = originQuery({
-  where: `AND prefix BETWEEN :prefix AND :prefix || X'FFFF'`,
-  having: `OR bookmarked`,
-});
+const SQL_ORIGIN_QUERY = originQuery();
 
-const QUERY_ORIGIN_HISTORY = originQuery({
-  select: `, (
-    SELECT TOTAL(visit_count) > 0
-    FROM moz_places
-    WHERE moz_places.origin_id = moz_origins.id
-   ) AS visited`,
-  having: `AND (visited OR NOT bookmarked)`,
-});
+const SQL_ORIGIN_PREFIX_QUERY = originQuery(
+  `AND prefix BETWEEN :prefix AND :prefix || X'FFFF'`
+);
+
+const SQL_ORIGIN_NOT_BOOKMARKED_QUERY = originQuery(`AND NOT bookmarked`);
 
-const QUERY_ORIGIN_PREFIX_HISTORY = originQuery({
-  select: `, (
-    SELECT TOTAL(visit_count) > 0
-    FROM moz_places
-    WHERE moz_places.origin_id = moz_origins.id
-   ) AS visited`,
-  where: `AND prefix BETWEEN :prefix AND :prefix || X'FFFF'`,
-  having: `AND (visited OR NOT bookmarked)`,
-});
+const SQL_ORIGIN_PREFIX_NOT_BOOKMARKED_QUERY = originQuery(
+  `AND NOT bookmarked
+   AND prefix BETWEEN :prefix AND :prefix || X'FFFF'`
+);
 
-const QUERY_ORIGIN_BOOKMARK = originQuery({
-  having: `AND bookmarked`,
-});
+const SQL_ORIGIN_BOOKMARKED_QUERY = originQuery(`AND bookmarked`);
 
-const QUERY_ORIGIN_PREFIX_BOOKMARK = originQuery({
-  where: `AND prefix BETWEEN :prefix AND :prefix || X'FFFF'`,
-  having: `AND bookmarked`,
-});
+const SQL_ORIGIN_PREFIX_BOOKMARKED_QUERY = originQuery(
+  `AND bookmarked
+   AND prefix BETWEEN :prefix AND :prefix || X'FFFF'`
+);
 
 // Result row indexes for urlQuery()
 const QUERYINDEX_URL_URL = 1;
 const QUERYINDEX_URL_STRIPPED_URL = 2;
 const QUERYINDEX_URL_FRECENCY = 3;
 
-function urlQuery(where1, where2) {
+function urlQuery(conditions1, conditions2) {
   // We limit the search to places that are either bookmarked or have a frecency
   // over some small, arbitrary threshold (20) in order to avoid scanning as few
   // rows as possible.  Keep in mind that we run this query every time the user
   // types a key when the urlbar value looks like a URL with a path.
   return `/* do not warn (bug no): cannot use an index to sort */
           SELECT :query_type,
                  url,
                  :strippedURL,
                  frecency,
                  foreign_count > 0 AS bookmarked,
-                 visit_count > 0 AS visited,
                  id
           FROM moz_places
           WHERE rev_host = :revHost
-                ${where1}
+                AND (bookmarked OR frecency > 20)
+                ${conditions1}
           UNION ALL
           SELECT :query_type,
                  url,
                  :strippedURL,
                  frecency,
                  foreign_count > 0 AS bookmarked,
-                 visit_count > 0 AS visited,
                  id
           FROM moz_places
           WHERE rev_host = :revHost || 'www.'
-                ${where2}
+                AND (bookmarked OR frecency > 20)
+                ${conditions2}
           ORDER BY frecency DESC, id DESC
           LIMIT 1 `;
 }
 
-const QUERY_URL_HISTORY_BOOKMARK = urlQuery(
-  `AND (bookmarked OR frecency > 20)
+const SQL_URL_QUERY = urlQuery(
+  `AND strip_prefix_and_userinfo(url) BETWEEN :strippedURL AND :strippedURL || X'FFFF'`,
+  `AND strip_prefix_and_userinfo(url) BETWEEN 'www.' || :strippedURL AND 'www.' || :strippedURL || X'FFFF'`
+);
+
+const SQL_URL_PREFIX_QUERY = urlQuery(
+  `AND url BETWEEN :prefix || :strippedURL AND :prefix || :strippedURL || X'FFFF'`,
+  `AND url BETWEEN :prefix || 'www.' || :strippedURL AND :prefix || 'www.' || :strippedURL || X'FFFF'`
+);
+
+const SQL_URL_NOT_BOOKMARKED_QUERY = urlQuery(
+  `AND NOT bookmarked
    AND strip_prefix_and_userinfo(url) BETWEEN :strippedURL AND :strippedURL || X'FFFF'`,
-  `AND (bookmarked OR frecency > 20)
+  `AND NOT bookmarked
    AND strip_prefix_and_userinfo(url) BETWEEN 'www.' || :strippedURL AND 'www.' || :strippedURL || X'FFFF'`
 );
 
-const QUERY_URL_PREFIX_HISTORY_BOOKMARK = urlQuery(
-  `AND (bookmarked OR frecency > 20)
+const SQL_URL_PREFIX_NOT_BOOKMARKED_QUERY = urlQuery(
+  `AND NOT bookmarked
    AND url BETWEEN :prefix || :strippedURL AND :prefix || :strippedURL || X'FFFF'`,
-  `AND (bookmarked OR frecency > 20)
+  `AND NOT bookmarked
    AND url BETWEEN :prefix || 'www.' || :strippedURL AND :prefix || 'www.' || :strippedURL || X'FFFF'`
 );
 
-const QUERY_URL_HISTORY = urlQuery(
-  `AND (visited OR NOT bookmarked)
-   AND frecency > 20
-   AND strip_prefix_and_userinfo(url) BETWEEN :strippedURL AND :strippedURL || X'FFFF'`,
-  `AND (visited OR NOT bookmarked)
-   AND frecency > 20
-   AND strip_prefix_and_userinfo(url) BETWEEN 'www.' || :strippedURL AND 'www.' || :strippedURL || X'FFFF'`
-);
-
-const QUERY_URL_PREFIX_HISTORY = urlQuery(
-  `AND (visited OR NOT bookmarked)
-   AND frecency > 20
-   AND url BETWEEN :prefix || :strippedURL AND :prefix || :strippedURL || X'FFFF'`,
-  `AND (visited OR NOT bookmarked)
-   AND frecency > 20
-   AND url BETWEEN :prefix || 'www.' || :strippedURL AND :prefix || 'www.' || :strippedURL || X'FFFF'`
-);
-
-const QUERY_URL_BOOKMARK = urlQuery(
+const SQL_URL_BOOKMARKED_QUERY = urlQuery(
   `AND bookmarked
    AND strip_prefix_and_userinfo(url) BETWEEN :strippedURL AND :strippedURL || X'FFFF'`,
   `AND bookmarked
    AND strip_prefix_and_userinfo(url) BETWEEN 'www.' || :strippedURL AND 'www.' || :strippedURL || X'FFFF'`
 );
 
-const QUERY_URL_PREFIX_BOOKMARK = urlQuery(
+const SQL_URL_PREFIX_BOOKMARKED_QUERY = urlQuery(
   `AND bookmarked
    AND url BETWEEN :prefix || :strippedURL AND :prefix || :strippedURL || X'FFFF'`,
   `AND bookmarked
    AND url BETWEEN :prefix || 'www.' || :strippedURL AND :prefix || 'www.' || :strippedURL || X'FFFF'`
 );
 
 // Getters
 
@@ -2645,35 +2618,33 @@ Search.prototype = {
       stddevMultiplier: UrlbarPrefs.get("autoFill.stddevMultiplier"),
     };
     if (this._strippedPrefix) {
       opts.prefix = this._strippedPrefix;
     }
 
     if (this.hasBehavior("history") && this.hasBehavior("bookmark")) {
       return [
-        this._strippedPrefix
-          ? QUERY_ORIGIN_PREFIX_HISTORY_BOOKMARK
-          : QUERY_ORIGIN_HISTORY_BOOKMARK,
+        this._strippedPrefix ? SQL_ORIGIN_PREFIX_QUERY : SQL_ORIGIN_QUERY,
         opts,
       ];
     }
     if (this.hasBehavior("history")) {
       return [
         this._strippedPrefix
-          ? QUERY_ORIGIN_PREFIX_HISTORY
-          : QUERY_ORIGIN_HISTORY,
+          ? SQL_ORIGIN_PREFIX_NOT_BOOKMARKED_QUERY
+          : SQL_ORIGIN_NOT_BOOKMARKED_QUERY,
         opts,
       ];
     }
     if (this.hasBehavior("bookmark")) {
       return [
         this._strippedPrefix
-          ? QUERY_ORIGIN_PREFIX_BOOKMARK
-          : QUERY_ORIGIN_BOOKMARK,
+          ? SQL_ORIGIN_PREFIX_BOOKMARKED_QUERY
+          : SQL_ORIGIN_BOOKMARKED_QUERY,
         opts,
       ];
     }
     throw new Error("Either history or bookmark behavior expected");
   },
 
   /**
    * Obtains the query to search for autoFill url results.
@@ -2717,35 +2688,33 @@ Search.prototype = {
       strippedURL,
     };
     if (this._strippedPrefix) {
       opts.prefix = this._strippedPrefix;
     }
 
     if (this.hasBehavior("history") && this.hasBehavior("bookmark")) {
       return [
-        this._strippedPrefix
-          ? QUERY_URL_PREFIX_HISTORY_BOOKMARK
-          : QUERY_URL_HISTORY_BOOKMARK,
+        this._strippedPrefix ? SQL_URL_PREFIX_QUERY : SQL_URL_QUERY,
         opts,
       ];
     }
     if (this.hasBehavior("history")) {
       return [
         this._strippedPrefix
-          ? QUERY_URL_PREFIX_HISTORY
-          : QUERY_URL_HISTORY,
+          ? SQL_URL_PREFIX_NOT_BOOKMARKED_QUERY
+          : SQL_URL_NOT_BOOKMARKED_QUERY,
         opts,
       ];
     }
     if (this.hasBehavior("bookmark")) {
       return [
         this._strippedPrefix
-          ? QUERY_URL_PREFIX_BOOKMARK
-          : QUERY_URL_BOOKMARK,
+          ? SQL_URL_PREFIX_BOOKMARKED_QUERY
+          : SQL_URL_BOOKMARKED_QUERY,
         opts,
       ];
     }
     throw new Error("Either history or bookmark behavior expected");
   },
 
   // The result is notified to the search listener on a timer, to chunk multiple
   // match updates together and avoid rebuilding the popup at every new match.
--- a/toolkit/components/places/tests/unifiedcomplete/autofill_tasks.js
+++ b/toolkit/components/places/tests/unifiedcomplete/autofill_tasks.js
@@ -1240,24 +1240,24 @@ function addAutofillTasks(origins) {
     await cleanup();
   });
 
   // Tests interaction between the suggest.history and suggest.bookmark prefs.
   //
   // Config:
   //   suggest.history = true
   //   suggest.bookmark = false
-  //   search for: unvisited bookmark
+  //   search for: bookmark
   //   prefix search: no
   //   prefix matches search: n/a
   //   origin matches search: yes
   //
   // Expected result:
   //   should autofill: no
-  add_task(async function suggestBookmarkFalse_unvisitedBookmark() {
+  add_task(async function suggestBookmarkFalse_bookmark() {
     await addBookmark({
       uri: "http://" + url,
     });
     await check_autocomplete({
       search,
       autofilled: url,
       completed: "http://" + url,
       matches: [
@@ -1276,24 +1276,24 @@ function addAutofillTasks(origins) {
     await cleanup();
   });
 
   // Tests interaction between the suggest.history and suggest.bookmark prefs.
   //
   // Config:
   //   suggest.history = true
   //   suggest.bookmark = false
-  //   search for: unvisited bookmark
+  //   search for: bookmark
   //   prefix search: yes
   //   prefix matches search: yes
   //   origin matches search: yes
   //
   // Expected result:
   //   should autofill: no
-  add_task(async function suggestBookmarkFalse_unvisitedBookmark_prefix_0() {
+  add_task(async function suggestBookmarkFalse_bookmark_prefix() {
     await addBookmark({
       uri: "http://" + url,
     });
     await check_autocomplete({
       search: "http://" + search,
       autofilled: "http://" + url,
       completed: "http://" + url,
       matches: [
@@ -1306,554 +1306,16 @@ function addAutofillTasks(origins) {
     });
     Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
     await check_autocomplete({
       search: "http://" + search,
       matches: [],
     });
     await cleanup();
   });
-
-  // Tests interaction between the suggest.history and suggest.bookmark prefs.
-  //
-  // Config:
-  //   suggest.history = true
-  //   suggest.bookmark = false
-  //   search for: unvisited bookmark
-  //   prefix search: yes
-  //   prefix matches search: no
-  //   origin matches search: yes
-  //
-  // Expected result:
-  //   should autofill: no
-  add_task(async function suggestBookmarkFalse_unvisitedBookmark_prefix_1() {
-    await addBookmark({
-      uri: "ftp://" + url,
-    });
-    Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-    await check_autocomplete({
-      search: "http://" + search,
-      matches: [],
-    });
-    await cleanup();
-  });
-
-  // Tests interaction between the suggest.history and suggest.bookmark prefs.
-  //
-  // Config:
-  //   suggest.history = true
-  //   suggest.bookmark = false
-  //   search for: unvisited bookmark
-  //   prefix search: yes
-  //   prefix matches search: yes
-  //   origin matches search: no
-  //
-  // Expected result:
-  //   should autofill: no
-  add_task(async function suggestBookmarkFalse_unvisitedBookmark_prefix_2() {
-    await addBookmark({
-      uri: "http://non-matching-" + url,
-    });
-    Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-    await check_autocomplete({
-      search: "http://" + search,
-      matches: [],
-    });
-    await cleanup();
-  });
-
-  // Tests interaction between the suggest.history and suggest.bookmark prefs.
-  //
-  // Config:
-  //   suggest.history = true
-  //   suggest.bookmark = false
-  //   search for: unvisited bookmark
-  //   prefix search: yes
-  //   prefix matches search: no
-  //   origin matches search: no
-  //
-  // Expected result:
-  //   should autofill: no
-  add_task(async function suggestBookmarkFalse_unvisitedBookmark_prefix_3() {
-    await addBookmark({
-      uri: "ftp://non-matching-" + url,
-    });
-    Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-    await check_autocomplete({
-      search: "http://" + search,
-      matches: [],
-    });
-    await cleanup();
-  });
-
-  // Tests interaction between the suggest.history and suggest.bookmark prefs.
-  //
-  // Config:
-  //   suggest.history = true
-  //   suggest.bookmark = false
-  //   search for: visited bookmark above autofill threshold
-  //   prefix search: no
-  //   prefix matches search: n/a
-  //   origin matches search: yes
-  //
-  // Expected result:
-  //   should autofill: yes
-  add_task(async function suggestBookmarkFalse_visitedBookmark_above() {
-    await PlacesTestUtils.addVisits("http://" + url);
-    await addBookmark({
-      uri: "http://" + url,
-    });
-    Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-    await check_autocomplete({
-      search,
-      autofilled: url,
-      completed: "http://" + url,
-      matches: [
-        {
-          value: url,
-          comment,
-          style: ["autofill", "heuristic"],
-        },
-      ],
-    });
-    await cleanup();
-  });
-
-  // Tests interaction between the suggest.history and suggest.bookmark prefs.
-  //
-  // Config:
-  //   suggest.history = true
-  //   suggest.bookmark = false
-  //   search for: visited bookmark above autofill threshold
-  //   prefix search: yes
-  //   prefix matches search: yes
-  //   origin matches search: yes
-  //
-  // Expected result:
-  //   should autofill: yes
-  add_task(async function suggestBookmarkFalse_visitedBookmarkAbove_prefix_0() {
-    await PlacesTestUtils.addVisits("http://" + url);
-    await addBookmark({
-      uri: "http://" + url,
-    });
-    Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-    await check_autocomplete({
-      search: "http://" + search,
-      autofilled: "http://" + url,
-      completed: "http://" + url,
-      matches: [
-        {
-          value: "http://" + url,
-          comment,
-          style: ["autofill", "heuristic"],
-        },
-      ],
-    });
-    await cleanup();
-  });
-
-  // Tests interaction between the suggest.history and suggest.bookmark prefs.
-  //
-  // Config:
-  //   suggest.history = true
-  //   suggest.bookmark = false
-  //   search for: visited bookmark above autofill threshold
-  //   prefix search: yes
-  //   prefix matches search: no
-  //   origin matches search: yes
-  //
-  // Expected result:
-  //   should autofill: no
-  add_task(async function suggestBookmarkFalse_visitedBookmarkAbove_prefix_1() {
-    await PlacesTestUtils.addVisits("ftp://" + url);
-    await addBookmark({
-      uri: "ftp://" + url,
-    });
-    Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-    await check_autocomplete({
-      search: "http://" + search,
-      matches: [
-        {
-          value: "ftp://" + url,
-          comment: "A bookmark",
-          style: ["favicon"],
-        },
-      ],
-    });
-    await cleanup();
-  });
-
-  // Tests interaction between the suggest.history and suggest.bookmark prefs.
-  //
-  // Config:
-  //   suggest.history = true
-  //   suggest.bookmark = false
-  //   search for: visited bookmark above autofill threshold
-  //   prefix search: yes
-  //   prefix matches search: yes
-  //   origin matches search: no
-  //
-  // Expected result:
-  //   should autofill: no
-  add_task(async function suggestBookmarkFalse_visitedBookmarkAbove_prefix_2() {
-    await PlacesTestUtils.addVisits("http://non-matching-" + url);
-    await addBookmark({
-      uri: "http://non-matching-" + url,
-    });
-    Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-    await check_autocomplete({
-      search: "http://" + search,
-      matches: [
-        {
-          value: "http://non-matching-" + url,
-          comment: "A bookmark",
-          style: ["favicon"],
-        },
-      ],
-    });
-    await cleanup();
-  });
-
-  // Tests interaction between the suggest.history and suggest.bookmark prefs.
-  //
-  // Config:
-  //   suggest.history = true
-  //   suggest.bookmark = false
-  //   search for: visited bookmark above autofill threshold
-  //   prefix search: yes
-  //   prefix matches search: no
-  //   origin matches search: no
-  //
-  // Expected result:
-  //   should autofill: no
-  add_task(async function suggestBookmarkFalse_visitedBookmarkAbove_prefix_3() {
-    await PlacesTestUtils.addVisits("ftp://non-matching-" + url);
-    await addBookmark({
-      uri: "ftp://non-matching-" + url,
-    });
-    Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-    await check_autocomplete({
-      search: "http://" + search,
-      matches: [
-        {
-          value: "ftp://non-matching-" + url,
-          comment: "A bookmark",
-          style: ["favicon"],
-        },
-      ],
-    });
-    await cleanup();
-  });
-
-  // The following suggestBookmarkFalse_visitedBookmarkBelow* tests are similar
-  // to the suggestBookmarkFalse_visitedBookmarkAbove* tests, but instead of
-  // checking visited bookmarks above the autofill threshold, they check visited
-  // bookmarks below the threshold.  These tests don't make sense for URL
-  // queries (as opposed to origin queries) because URL queries don't use the
-  // same autofill threshold, so we skip them when !origins.
-
-  // Tests interaction between the suggest.history and suggest.bookmark prefs.
-  //
-  // Config:
-  //   suggest.history = true
-  //   suggest.bookmark = false
-  //   search for: visited bookmark below autofill threshold
-  //   prefix search: no
-  //   prefix matches search: n/a
-  //   origin matches search: yes
-  //
-  // Expected result:
-  //   should autofill: no
-  add_task(async function suggestBookmarkFalse_visitedBookmarkBelow() {
-    if (!origins) {
-      // See comment above suggestBookmarkFalse_visitedBookmarkBelow.
-      return;
-    }
-    // First, make sure that `url` is below the autofill threshold.
-    await PlacesTestUtils.addVisits("http://" + url);
-    for (let i = 0; i < 3; i++) {
-      await PlacesTestUtils.addVisits("http://some-other-" + url);
-    }
-    await check_autocomplete({
-      search,
-      matches: [
-        {
-          value: "http://some-other-" + url,
-          comment: "test visit for http://some-other-" + url,
-          style: ["favicon"],
-        },
-        {
-          value: "http://" + url,
-          comment: "test visit for http://" + url,
-          style: ["favicon"],
-        },
-      ],
-    });
-    // Now bookmark it and set suggest.bookmark to false.
-    await addBookmark({
-      uri: "http://" + url,
-    });
-    Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-    await check_autocomplete({
-      search,
-      matches: [
-        {
-          value: "http://some-other-" + url,
-          comment: "test visit for http://some-other-" + url,
-          style: ["favicon"],
-        },
-        {
-          value: "http://" + url,
-          comment: "A bookmark",
-          style: ["favicon"],
-        },
-      ],
-    });
-    await cleanup();
-  });
-
-  // Tests interaction between the suggest.history and suggest.bookmark prefs.
-  //
-  // Config:
-  //   suggest.history = true
-  //   suggest.bookmark = false
-  //   search for: visited bookmark below autofill threshold
-  //   prefix search: yes
-  //   prefix matches search: yes
-  //   origin matches search: yes
-  //
-  // Expected result:
-  //   should autofill: no
-  add_task(async function suggestBookmarkFalse_visitedBookmarkBelow_prefix_0() {
-    if (!origins) {
-      // See comment above suggestBookmarkFalse_visitedBookmarkBelow.
-      return;
-    }
-    // First, make sure that `url` is below the autofill threshold.
-    await PlacesTestUtils.addVisits("http://" + url);
-    for (let i = 0; i < 3; i++) {
-      await PlacesTestUtils.addVisits("http://some-other-" + url);
-    }
-    await check_autocomplete({
-      search: "http://" + search,
-      matches: [
-        {
-          value: "http://some-other-" + url,
-          comment: "test visit for http://some-other-" + url,
-          style: ["favicon"],
-        },
-        {
-          value: "http://" + url,
-          comment: "test visit for http://" + url,
-          style: ["favicon"],
-        },
-      ],
-    });
-    // Now bookmark it and set suggest.bookmark to false.
-    await addBookmark({
-      uri: "http://" + url,
-    });
-    Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-    await check_autocomplete({
-      search: "http://" + search,
-      matches: [
-        {
-          value: "http://some-other-" + url,
-          comment: "test visit for http://some-other-" + url,
-          style: ["favicon"],
-        },
-        {
-          value: "http://" + url,
-          comment: "A bookmark",
-          style: ["favicon"],
-        },
-      ],
-    });
-    await cleanup();
-  });
-
-  // Tests interaction between the suggest.history and suggest.bookmark prefs.
-  //
-  // Config:
-  //   suggest.history = true
-  //   suggest.bookmark = false
-  //   search for: visited bookmark below autofill threshold
-  //   prefix search: yes
-  //   prefix matches search: no
-  //   origin matches search: yes
-  //
-  // Expected result:
-  //   should autofill: no
-  add_task(async function suggestBookmarkFalse_visitedBookmarkBelow_prefix_1() {
-    if (!origins) {
-      // See comment above suggestBookmarkFalse_visitedBookmarkBelow.
-      return;
-    }
-    // First, make sure that `url` is below the autofill threshold.
-    await PlacesTestUtils.addVisits("ftp://" + url);
-    for (let i = 0; i < 3; i++) {
-      await PlacesTestUtils.addVisits("ftp://some-other-" + url);
-    }
-    await check_autocomplete({
-      search: "http://" + search,
-      matches: [
-        {
-          value: "ftp://some-other-" + url,
-          comment: "test visit for ftp://some-other-" + url,
-          style: ["favicon"],
-        },
-        {
-          value: "ftp://" + url,
-          comment: "test visit for ftp://" + url,
-          style: ["favicon"],
-        },
-      ],
-    });
-    // Now bookmark it and set suggest.bookmark to false.
-    await addBookmark({
-      uri: "ftp://" + url,
-    });
-    Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-    await check_autocomplete({
-      search: "http://" + search,
-      matches: [
-        {
-          value: "ftp://some-other-" + url,
-          comment: "test visit for ftp://some-other-" + url,
-          style: ["favicon"],
-        },
-        {
-          value: "ftp://" + url,
-          comment: "A bookmark",
-          style: ["favicon"],
-        },
-      ],
-    });
-    await cleanup();
-  });
-
-  // Tests interaction between the suggest.history and suggest.bookmark prefs.
-  //
-  // Config:
-  //   suggest.history = true
-  //   suggest.bookmark = false
-  //   search for: visited bookmark below autofill threshold
-  //   prefix search: yes
-  //   prefix matches search: yes
-  //   origin matches search: no
-  //
-  // Expected result:
-  //   should autofill: no
-  add_task(async function suggestBookmarkFalse_visitedBookmarkBelow_prefix_2() {
-    if (!origins) {
-      // See comment above suggestBookmarkFalse_visitedBookmarkBelow.
-      return;
-    }
-    // First, make sure that `url` is below the autofill threshold.
-    await PlacesTestUtils.addVisits("http://non-matching-" + url);
-    for (let i = 0; i < 3; i++) {
-      await PlacesTestUtils.addVisits("http://some-other-" + url);
-    }
-    await check_autocomplete({
-      search: "http://" + search,
-      matches: [
-        {
-          value: "http://some-other-" + url,
-          comment: "test visit for http://some-other-" + url,
-          style: ["favicon"],
-        },
-        {
-          value: "http://non-matching-" + url,
-          comment: "test visit for http://non-matching-" + url,
-          style: ["favicon"],
-        },
-      ],
-    });
-    // Now bookmark it and set suggest.bookmark to false.
-    await addBookmark({
-      uri: "http://non-matching-" + url,
-    });
-    Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-    await check_autocomplete({
-      search: "http://" + search,
-      matches: [
-        {
-          value: "http://some-other-" + url,
-          comment: "test visit for http://some-other-" + url,
-          style: ["favicon"],
-        },
-        {
-          value: "http://non-matching-" + url,
-          comment: "A bookmark",
-          style: ["favicon"],
-        },
-      ],
-    });
-    await cleanup();
-  });
-
-  // Tests interaction between the suggest.history and suggest.bookmark prefs.
-  //
-  // Config:
-  //   suggest.history = true
-  //   suggest.bookmark = false
-  //   search for: visited bookmark below autofill threshold
-  //   prefix search: yes
-  //   prefix matches search: no
-  //   origin matches search: no
-  //
-  // Expected result:
-  //   should autofill: no
-  add_task(async function suggestBookmarkFalse_visitedBookmarkBelow_prefix_3() {
-    if (!origins) {
-      // See comment above suggestBookmarkFalse_visitedBookmarkBelow.
-      return;
-    }
-    // First, make sure that `url` is below the autofill threshold.
-    await PlacesTestUtils.addVisits("ftp://non-matching-" + url);
-    for (let i = 0; i < 3; i++) {
-      await PlacesTestUtils.addVisits("ftp://some-other-" + url);
-    }
-    await check_autocomplete({
-      search: "http://" + search,
-      matches: [
-        {
-          value: "ftp://some-other-" + url,
-          comment: "test visit for ftp://some-other-" + url,
-          style: ["favicon"],
-        },
-        {
-          value: "ftp://non-matching-" + url,
-          comment: "test visit for ftp://non-matching-" + url,
-          style: ["favicon"],
-        },
-      ],
-    });
-    // Now bookmark it and set suggest.bookmark to false.
-    await addBookmark({
-      uri: "ftp://non-matching-" + url,
-    });
-    Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-    await check_autocomplete({
-      search: "http://" + search,
-      matches: [
-        {
-          value: "ftp://some-other-" + url,
-          comment: "test visit for ftp://some-other-" + url,
-          style: ["favicon"],
-        },
-        {
-          value: "ftp://non-matching-" + url,
-          comment: "A bookmark",
-          style: ["favicon"],
-        },
-      ],
-    });
-    await cleanup();
-  });
 }
 
 /**
  * Returns the frecency of an origin.
  *
  * @param   {string} prefix
  *          The origin's prefix, e.g., "http://".
  * @param   {string} host