Skip to content

Commit

Permalink
Merge branch 'hotfix/5.57.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
subsymbolic committed Jun 25, 2020
2 parents 321eb8d + e1951f6 commit 3bf56e4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1990,6 +1990,12 @@ class BrowserTabViewModelTest {
assertFalse(browserViewState().showDaxIcon)
}

@Test
fun whenQueryIsNotHierarchicalThenUnsupportedOperationExceptionIsHandled() {
whenever(mockOmnibarConverter.convertQueryToUrl("about:blank", null)).thenReturn("about:blank")
testee.onUserSubmittedQuery("about:blank")
}

private inline fun <reified T : Command> assertCommandIssued(instanceAssertions: T.() -> Unit = {}) {
verify(mockCommandObserver, atLeastOnce()).onChanged(commandCaptor.capture())
val issuedCommand = commandCaptor.allValues.find { it is T }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import timber.log.Timber
import java.lang.UnsupportedOperationException
import java.util.Locale
import java.util.concurrent.TimeUnit

Expand Down Expand Up @@ -445,8 +446,20 @@ class BrowserTabViewModel(
}

private fun fireQueryChangedPixel(omnibarText: String) {
val oldParameter = currentOmnibarViewState().omnibarText.toUri()?.getQueryParameter(AppUrl.ParamKey.QUERY)
val newParameter = omnibarText.toUri()?.getQueryParameter(AppUrl.ParamKey.QUERY)
val oldUri = currentOmnibarViewState().omnibarText.toUri()
val newUri = omnibarText.toUri()

val oldParameter = try {
oldUri.getQueryParameter(AppUrl.ParamKey.QUERY)
} catch (e: UnsupportedOperationException) {
null
}
val newParameter = try {
newUri.getQueryParameter(AppUrl.ParamKey.QUERY)
} catch (e: UnsupportedOperationException) {
null
}

if (oldParameter == newParameter) {
pixel.fire(String.format(Locale.US, PixelName.SERP_REQUERY.pixelName, PixelParameter.SERP_QUERY_NOT_CHANGED))
} else {
Expand Down
2 changes: 1 addition & 1 deletion app/version/version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=5.57.0
VERSION=5.57.1

0 comments on commit 3bf56e4

Please sign in to comment.