Skip to content

Commit 8a26253

Browse files
authored
Remove dead code related to old omnibar (#6818)
Task/Issue URL: https://app.asana.com/1/137249556945/project/1198194956794324/task/1211398949646942?focus=true ### Description Remove dead code from the old omnibar ### Steps to test this PR QA optional, just removing dead code
1 parent c3b2c4a commit 8a26253

File tree

2 files changed

+0
-140
lines changed

2 files changed

+0
-140
lines changed

app/src/androidTest/java/com/duckduckgo/app/browser/BrowserTabViewModelTest.kt

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import android.net.http.SslError
2626
import android.os.Build
2727
import android.print.PrintAttributes
2828
import android.view.MenuItem
29-
import android.view.MotionEvent
3029
import android.view.View
3130
import android.webkit.HttpAuthHandler
3231
import android.webkit.PermissionRequest
@@ -5616,110 +5615,6 @@ class BrowserTabViewModelTest {
56165615
verify(mockPixel).fire(AppPixelName.TAB_MANAGER_CLICKED_DAILY, params, emptyMap(), Daily())
56175616
}
56185617

5619-
@Test
5620-
fun whenOnUserTouchedOmnibarTextInputWithEmptyTextAndActionUpThenPixelFired() {
5621-
testee.onUserTouchedOmnibarTextInput(MotionEvent.ACTION_UP)
5622-
5623-
verify(mockPixel).fire(AppPixelName.ADDRESS_BAR_NEW_TAB_PAGE_CLICKED)
5624-
}
5625-
5626-
@Test
5627-
fun whenOnUserTouchedOmnibarTextInputWithUrlAndActionUpThenPixelFired() {
5628-
loadUrl("https://example.com")
5629-
testee.onUserTouchedOmnibarTextInput(MotionEvent.ACTION_UP)
5630-
5631-
verify(mockPixel).fire(AppPixelName.ADDRESS_BAR_WEBSITE_CLICKED)
5632-
}
5633-
5634-
@Test
5635-
fun whenOnUserTouchedOmnibarTextInputWithQueryAndActionUpThenPixelFired() {
5636-
loadUrl("https://duckduckgo.com/?q=example")
5637-
testee.onUserTouchedOmnibarTextInput(MotionEvent.ACTION_UP)
5638-
5639-
verify(mockPixel).fire(AppPixelName.ADDRESS_BAR_SERP_CLICKED)
5640-
}
5641-
5642-
@Test
5643-
fun whenOnUserTouchedOmnibarTextInputWithAnyTextAndOtherActionThenPixelNotFired() {
5644-
loadUrl("https://duckduckgo.com/?q=example")
5645-
testee.onUserTouchedOmnibarTextInput(MotionEvent.ACTION_DOWN)
5646-
5647-
verify(mockPixel, never()).fire(AppPixelName.ADDRESS_BAR_NEW_TAB_PAGE_CLICKED)
5648-
verify(mockPixel, never()).fire(AppPixelName.ADDRESS_BAR_WEBSITE_CLICKED)
5649-
verify(mockPixel, never()).fire(AppPixelName.ADDRESS_BAR_SERP_CLICKED)
5650-
}
5651-
5652-
@Test
5653-
fun whenOnClearOmnibarTextInputWithEmptyTextThenPixelFired() {
5654-
testee.onClearOmnibarTextInput()
5655-
5656-
verify(mockPixel).fire(AppPixelName.ADDRESS_BAR_NEW_TAB_PAGE_ENTRY_CLEARED)
5657-
}
5658-
5659-
@Test
5660-
fun whenOnClearOmnibarTextInputWithUrlThenPixelFired() {
5661-
loadUrl("https://example.com")
5662-
testee.onClearOmnibarTextInput()
5663-
5664-
verify(mockPixel).fire(AppPixelName.ADDRESS_BAR_WEBSITE_ENTRY_CLEARED)
5665-
}
5666-
5667-
@Test
5668-
fun whenOnClearOmnibarTextInputWithQueryUrlThenPixelFired() {
5669-
loadUrl("https://duckduckgo.com/?q=example")
5670-
testee.onClearOmnibarTextInput()
5671-
5672-
verify(mockPixel).fire(AppPixelName.ADDRESS_BAR_SERP_ENTRY_CLEARED)
5673-
}
5674-
5675-
@Test
5676-
fun whenSendPixelsOnBackKeyPressedWithEmptyTextThenPixelFired() {
5677-
testee.sendPixelsOnBackKeyPressed()
5678-
5679-
verify(mockPixel).fire(AppPixelName.ADDRESS_BAR_NEW_TAB_PAGE_CANCELLED)
5680-
}
5681-
5682-
@Test
5683-
fun whenSendPixelsOnBackKeyPressedWithUrlThenPixelFired() {
5684-
loadUrl("https://example.com")
5685-
testee.sendPixelsOnBackKeyPressed()
5686-
5687-
verify(mockPixel).fire(AppPixelName.ADDRESS_BAR_WEBSITE_CANCELLED)
5688-
}
5689-
5690-
@Test
5691-
fun whenSendPixelsOnBackKeyPressedWithQueryUrlThenPixelFired() {
5692-
loadUrl("https://duckduckgo.com/?q=example")
5693-
5694-
testee.sendPixelsOnBackKeyPressed()
5695-
5696-
verify(mockPixel).fire(AppPixelName.ADDRESS_BAR_SERP_CANCELLED)
5697-
}
5698-
5699-
@Test
5700-
fun whenSendPixelsOnEnterKeyPressedWithEmptyTextThenPixelFired() {
5701-
testee.sendPixelsOnEnterKeyPressed()
5702-
5703-
verify(mockPixel).fire(AppPixelName.KEYBOARD_GO_NEW_TAB_CLICKED)
5704-
}
5705-
5706-
@Test
5707-
fun whenSendPixelsOnEnterKeyPressedWithUrlThenPixelFired() {
5708-
loadUrl("https://example.com")
5709-
testee.sendPixelsOnEnterKeyPressed()
5710-
5711-
verify(mockPixel).fire(AppPixelName.KEYBOARD_GO_WEBSITE_CLICKED)
5712-
}
5713-
5714-
@Test
5715-
fun whenSendPixelsOnEnterKeyPressedWithQueryUrlThenPixelFired() {
5716-
loadUrl("https://duckduckgo.com/?q=example")
5717-
5718-
testee.sendPixelsOnEnterKeyPressed()
5719-
5720-
verify(mockPixel).fire(AppPixelName.KEYBOARD_GO_SERP_CLICKED)
5721-
}
5722-
57235618
@Test
57245619
fun whenNewTabShownThenPixelIsFired() {
57255620
testee.onNewTabShown()

app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import android.provider.MediaStore
2626
import android.util.Patterns
2727
import android.view.ContextMenu
2828
import android.view.MenuItem
29-
import android.view.MotionEvent.ACTION_UP
3029
import android.view.View
3130
import android.webkit.MimeTypeMap
3231
import android.webkit.PermissionRequest
@@ -4188,40 +4187,6 @@ class BrowserTabViewModel @Inject constructor(
41884187
return currentBrowserViewState().isPrinting
41894188
}
41904189

4191-
fun onUserTouchedOmnibarTextInput(touchAction: Int) {
4192-
if (touchAction == ACTION_UP) {
4193-
firePixelBasedOnCurrentUrl(
4194-
AppPixelName.ADDRESS_BAR_NEW_TAB_PAGE_CLICKED,
4195-
AppPixelName.ADDRESS_BAR_SERP_CLICKED,
4196-
AppPixelName.ADDRESS_BAR_WEBSITE_CLICKED,
4197-
)
4198-
}
4199-
}
4200-
4201-
fun onClearOmnibarTextInput() {
4202-
firePixelBasedOnCurrentUrl(
4203-
AppPixelName.ADDRESS_BAR_NEW_TAB_PAGE_ENTRY_CLEARED,
4204-
AppPixelName.ADDRESS_BAR_SERP_ENTRY_CLEARED,
4205-
AppPixelName.ADDRESS_BAR_WEBSITE_ENTRY_CLEARED,
4206-
)
4207-
}
4208-
4209-
fun sendPixelsOnBackKeyPressed() {
4210-
firePixelBasedOnCurrentUrl(
4211-
AppPixelName.ADDRESS_BAR_NEW_TAB_PAGE_CANCELLED,
4212-
AppPixelName.ADDRESS_BAR_SERP_CANCELLED,
4213-
AppPixelName.ADDRESS_BAR_WEBSITE_CANCELLED,
4214-
)
4215-
}
4216-
4217-
fun sendPixelsOnEnterKeyPressed() {
4218-
firePixelBasedOnCurrentUrl(
4219-
AppPixelName.KEYBOARD_GO_NEW_TAB_CLICKED,
4220-
AppPixelName.KEYBOARD_GO_SERP_CLICKED,
4221-
AppPixelName.KEYBOARD_GO_WEBSITE_CLICKED,
4222-
)
4223-
}
4224-
42254190
fun hasOmnibarPositionChanged(currentPosition: OmnibarPosition): Boolean = settingsDataStore.omnibarPosition != currentPosition
42264191

42274192
private fun firePixelBasedOnCurrentUrl(

0 commit comments

Comments
 (0)