gecko-dev/browser/components/privatebrowsing/test/browser
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
..
browser.ini
browser_oa_private_browsing_window.js Bug 1633710 - Move uri.spec calls to nsIPrincipal r=necko-reviewers,geckoview-reviewers,preferences-reviewers,ckerschb,ntim,snorp,valentin 2020-08-04 11:10:41 +00:00
browser_privatebrowsing_about.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
browser_privatebrowsing_about_search_banner.js
browser_privatebrowsing_aboutSessionRestore.js
browser_privatebrowsing_blobUrl.js Bug 1619953 - P10 - Test browser_privatebrowsing_blobUrl.js modified to pass on win32 r=mccr8 2020-08-05 17:05:36 +00:00
browser_privatebrowsing_cache.js
browser_privatebrowsing_certexceptionsui.js
browser_privatebrowsing_cleanup.js
browser_privatebrowsing_concurrent.js
browser_privatebrowsing_concurrent_page.html
browser_privatebrowsing_context_and_chromeFlags.js
browser_privatebrowsing_crh.js
browser_privatebrowsing_downloadLastDir.js
browser_privatebrowsing_downloadLastDir_c.js
browser_privatebrowsing_downloadLastDir_toggle.js
browser_privatebrowsing_DownloadLastDirWithCPS.js
browser_privatebrowsing_favicon.js
browser_privatebrowsing_geoprompt_page.html
browser_privatebrowsing_history_shift_click.js
browser_privatebrowsing_lastpbcontextexited.js
browser_privatebrowsing_localStorage.js
browser_privatebrowsing_localStorage_before_after.js
browser_privatebrowsing_localStorage_before_after_page.html
browser_privatebrowsing_localStorage_before_after_page2.html
browser_privatebrowsing_localStorage_page1.html
browser_privatebrowsing_localStorage_page2.html
browser_privatebrowsing_newtab_from_popup.js
browser_privatebrowsing_nonbrowser.js
browser_privatebrowsing_noSessionRestoreMenuOption.js
browser_privatebrowsing_opendir.js
browser_privatebrowsing_placestitle.js
browser_privatebrowsing_placesTitleNoUpdate.html
browser_privatebrowsing_placesTitleNoUpdate.js
browser_privatebrowsing_popupblocker.js
browser_privatebrowsing_protocolhandler.js
browser_privatebrowsing_protocolhandler_page.html
browser_privatebrowsing_rememberprompt.js
browser_privatebrowsing_sidebar.js
browser_privatebrowsing_theming.js
browser_privatebrowsing_ui.js
browser_privatebrowsing_urlbarfocus.js
browser_privatebrowsing_windowtitle.js
browser_privatebrowsing_windowtitle_page.html
browser_privatebrowsing_xrprompt_page.html
browser_privatebrowsing_zoom.js
browser_privatebrowsing_zoomrestore.js
empty_file.html
file_favicon.html
file_favicon.png
file_favicon.png^headers^
file_triggeringprincipal_oa.html
head.js
popup.html
title.sjs