gecko-dev/browser/components/extensions/test/xpcshell
Drew Willcoxon 6d6402fb4e Bug 1658964 - Convert local restriction chars to search mode and make other improvements to search mode. r=harry
Summary of major changes:

* Bookmarks, history, and tabs restriction chars now enter search mode. I added
  a method to UrlbarProviderHeuristicFallback to return a result with a keyword
  when one of these is used.
* This fixes other bugs like recognizing aliases that are entered at the
  beginning of non-empty search strings, and not quasi-re-entering search mode
  when search mode is already entered and you type another alias.
* The heuristic now determines whether we enter search mode, similar to how it
  also determines whether we autofill. When the heuristic has a keyword but no
  keyword offer, and the keyword is one of the recognized search mode keywords,
  then we enter search mode, cancel the current query, and start a new query
  with the remainder of the search string after the keyword.
* I slightly changed how we detect an alias, but only when update2 is
  enabled. Now, an alias must be followed by a space; otherwise, the alias is
  not recognized and instead just remains part of the seach string. Because if
  we don't do that, then you end up in a strange situation after typing an alias
  but before pressing space: The heuristic says "Search with <engine with the
  alias>", but we haven't entered search mode yet because you haven't typed a
  space yet. This is true for both @aliaes and non-@aliases.
* A consequence of the previous point is that we can still autofill @aliases
  with a trailing space, which IMO is important. Then, once the user types any
  char (space or not), we immediately enter search mode with the query being
  whatever char they typed. This is less important after bug 1658605 landed, but
  it's still good to have.
* Previously, `UrlbarView.onQueryResults` called UrlbarInput in order to
  autofill after the first result is received. This is circuitous becaue the
  input already has an `onFirstResult` method, which I now use to enter search
  mode when appropriate. So I moved the autofill call from UrlbarView to
  `UrlbarInput.onFirstResult`.
* As I mentioned, I improved some test framework and simplified some related
  product (non-test) code. For example:
    * I removed `UrlbarUtils.KEYWORD_OFFER.NONE` in favor of just leaving
      `keywordOffer` as `undefined`.
    * `tailOffsetIndex` can now be `undefined` if it's not relevant.
    * I removed empty-string `icon` properties from payloads in favor of
      `undefined`.
    * In tests, I ignore `undefined` but present properties in payloads so they
      don't count when comparing payloads with `deepEqual`.
    * We weren't previously comparing `result.source` and `result.type` in
      xpcshell tests, and that's important IMO, so I added checks for those and
      updated tests.
    * `isSearchHistory` is redundant, so I removed it. For form history, we
      should be checking `result.source == HISTORY` and `result.type == SEARCH`.
* A bunch of tests needed to be updated for this new behavior.

Differential Revision: https://phabricator.services.mozilla.com/D87944
2020-09-02 00:52:12 +00:00
..
data Bug 1619926 - Remove old search config list.json files from tests as they aren't necessary anymore. r=daleharvey 2020-09-01 18:08:43 +00:00
.eslintrc.js
head.js Bug 1649518 - 1/3: revert a34e77d6c3bf in preparation of enabling osclientcerts by default r=mixedpuppy 2020-07-06 19:29:17 +00:00
test_ext_bookmarks.js
test_ext_browsingData.js
test_ext_browsingData_cookies_cache.js Bug 1638358 - Cookie Schemeful Same-Site - part 3 - update add/addNative methods, r=mayhemer,remote-protocol-reviewers,marionette-reviewers,maja_zf,MattN,whimboo 2020-06-02 13:49:27 +00:00
test_ext_browsingData_downloads.js
test_ext_browsingData_passwords.js
test_ext_browsingData_settings.js
test_ext_chrome_settings_overrides_home.js
test_ext_chrome_settings_overrides_update.js
test_ext_distribution_popup.js
test_ext_history.js
test_ext_homepage_overrides_private.js
test_ext_manifest.js
test_ext_manifest_commands.js
test_ext_manifest_omnibox.js
test_ext_manifest_permissions.js
test_ext_normandyAddonStudy.js
test_ext_pageAction_shutdown.js
test_ext_pkcs11_management.js Bug 1649518 - 1/3: revert a34e77d6c3bf in preparation of enabling osclientcerts by default r=mixedpuppy 2020-07-06 19:29:17 +00:00
test_ext_settings_overrides_defaults.js Bug 1635235 - Implement reading the allow override default search engine allowlist from remote settings. r=daleharvey 2020-05-26 19:40:42 +00:00
test_ext_settings_overrides_search.js Bug 1651665 - Remove http:-URL validation bypasses from chrome_settings_overrides.search_provider r=mixedpuppy 2020-07-10 17:51:41 +00:00
test_ext_settings_overrides_search_mozParam.js Bug 1626410 - Simplify the isAppProvided check for the modern search configuration. r=daleharvey 2020-05-05 09:29:02 +00:00
test_ext_settings_overrides_shutdown.js
test_ext_settings_validate.js
test_ext_topSites.js
test_ext_url_overrides_newtab.js
test_ext_url_overrides_newtab_update.js
test_ext_urlbar.js Bug 1658964 - Convert local restriction chars to search mode and make other improvements to search mode. r=harry 2020-09-02 00:52:12 +00:00
xpcshell.ini Bug 1619926 - Remove old search config list.json files from tests as they aren't necessary anymore. r=daleharvey 2020-09-01 18:08:43 +00:00