Commit f2c02ba7 authored by codrut.topliceanu's avatar codrut.topliceanu
Browse files

For #6751 - Disable autocompleting URLs when entering editmode in BrowserToolbar

parent e39f4a35
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -281,10 +281,7 @@ class BrowserToolbar @JvmOverloads constructor(
     */
    override fun editMode() {
        val urlValue = if (searchTerms.isEmpty()) url else searchTerms
        // Don't autocomplete search terms as they could be substrings of a suggested url
        val shouldAutoComplete = searchTerms.isEmpty()

        edit.updateUrl(urlValue.toString(), shouldAutoComplete)
        edit.updateUrl(urlValue.toString(), false)
        updateState(State.EDIT)
        edit.focus()
        edit.selectAll()
+3 −3
Original line number Diff line number Diff line
@@ -127,11 +127,11 @@ class BrowserToolbarTest {
        toolbar.edit = spy(toolbar.edit)

        toolbar.url = "https://www.mozilla.org"
        verify(toolbar.edit, never()).updateUrl("https://www.mozilla.org", true)
        verify(toolbar.edit, never()).updateUrl("https://www.mozilla.org", false)

        toolbar.editMode()

        verify(toolbar.edit).updateUrl("https://www.mozilla.org", true)
        verify(toolbar.edit).updateUrl("https://www.mozilla.org", false)
    }

    @Test
@@ -424,7 +424,7 @@ class BrowserToolbarTest {
        toolbar.url = "https://www.mozilla.org"
        toolbar.editMode()
        verify(toolbar.display).url = "https://www.mozilla.org"
        verify(toolbar.edit).updateUrl("https://www.mozilla.org", true)
        verify(toolbar.edit).updateUrl("https://www.mozilla.org", false)
    }

    @Test
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@ permalink: /changelog/
  * ⚠️ **This is a breaking change**: `AddonManager.enableAddon` and `AddonManager.disableAddon` have a new optional parameter  `source` that indicates why the extension is enabled/disabled.
  * ⚠️ **This is a breaking change**: `Map<String, String>.translate` now is marked as internal, if you are trying to translate the summary or the description of an add-on, use `Addon.translatedSummary` and `Addon.translatedDescription`.

* **feature-toolbar**
  * Disabled autocompleting when updating url upon entering edit mode in BrowserToolbar.

* **feature-media**
  * Muted media will not start the media service anymore, causing no media notification to be shown and no audio focus getting requested.