Skip to content

Commit 035bbf5

Browse files
committed
Fix issues after rebase
1 parent 17eca57 commit 035bbf5

File tree

4 files changed

+25
-21
lines changed

4 files changed

+25
-21
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ import com.duckduckgo.autoconsent.api.Autoconsent
6868
import com.duckduckgo.autofill.api.BrowserAutofill
6969
import com.duckduckgo.autofill.api.InternalTestUserChecker
7070
import com.duckduckgo.browser.api.JsInjectorPlugin
71+
import com.duckduckgo.browser.api.WebMessagingBrowserPlugin
7172
import com.duckduckgo.browser.api.WebViewVersionProvider
7273
import com.duckduckgo.common.test.CoroutineTestRule
7374
import com.duckduckgo.common.utils.CurrentTimeProvider

content-scope-scripts/content-scope-scripts-impl/src/test/java/com/duckduckgo/contentscopescripts/impl/messaging/ContentScopeScriptsPostMessageWrapperPluginTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ class ContentScopeScriptsPostMessageWrapperPluginTest {
6060

6161
testee.postMessage(subscriptionEventData, mockWebView)
6262

63-
verify(mockWebMessaging).postMessage(mockWebView, subscriptionEventData)
64-
}
63+
verify(mockWebMessaging).postMessage(mockWebView, subscriptionEventData)
64+
}
6565

6666
@Test
6767
fun whenWebViewCompatContentScopeScriptsIsNotEnabledThenPostMessageToContentScopeScriptsJsMessaging() =

js-messaging/js-messaging-impl/src/main/java/com/duckduckgo/js/messaging/impl/RealWebMessagingDelegate.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ import com.duckduckgo.js.messaging.api.WebMessagingStrategy
3838
import com.duckduckgo.js.messaging.api.WebViewCompatMessageCallback
3939
import com.squareup.anvil.annotations.ContributesBinding
4040
import com.squareup.moshi.Moshi
41-
import javax.inject.Inject
4241
import kotlinx.coroutines.CoroutineScope
4342
import kotlinx.coroutines.launch
4443
import logcat.LogPriority.ERROR
4544
import logcat.asLog
4645
import logcat.logcat
4746
import org.json.JSONObject
47+
import javax.inject.Inject
4848

4949
@ContributesBinding(AppScope::class)
5050
class RealWebMessagingDelegate @Inject constructor(
@@ -162,8 +162,8 @@ class RealWebMessagingDelegate @Inject constructor(
162162
webView: WebView,
163163
) {
164164
if (!strategy.canHandleMessaging()) {
165-
return
166-
}
165+
return
166+
}
167167

168168
runCatching {
169169
return@runCatching webViewCompatWrapper.addWebMessageListener(
@@ -181,7 +181,6 @@ class RealWebMessagingDelegate @Inject constructor(
181181
}.getOrElse { exception ->
182182
logcat(ERROR) { "Error adding WebMessageListener for ${strategy.objectName}: ${exception.asLog()}" }
183183
}
184-
185184
}
186185

187186
override suspend fun unregister(

js-messaging/js-messaging-impl/src/test/java/com/duckduckgo/js/messaging/impl/RealWebMessagingDelegateTest.kt

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -240,24 +240,28 @@ class RealWebMessagingDelegateTest {
240240
override suspend fun canHandleMessaging(): Boolean = canHandleMessaging
241241

242242
override fun getMessageHandlers(): List<WebViewCompatMessageHandler> {
243-
return listOf(object : WebViewCompatMessageHandler {
244-
override fun process(jsMessage: JsMessage): ProcessResult {
245-
return SendToConsumer
246-
}
247-
248-
override val featureName: String = "testFeature"
249-
override val methods: List<String> = listOf("testMethod")
250-
},)
243+
return listOf(
244+
object : WebViewCompatMessageHandler {
245+
override fun process(jsMessage: JsMessage): ProcessResult {
246+
return SendToConsumer
247+
}
248+
249+
override val featureName: String = "testFeature"
250+
override val methods: List<String> = listOf("testMethod")
251+
},
252+
)
251253
}
252254

253255
override fun getGlobalMessageHandler(): List<GlobalJsMessageHandler> {
254-
return listOf(object : GlobalJsMessageHandler {
255-
override fun process(jsMessage: JsMessage): ProcessResult {
256-
return SendToConsumer
257-
}
258-
259-
override val method: String = "globalMethod"
260-
},)
256+
return listOf(
257+
object : GlobalJsMessageHandler {
258+
override fun process(jsMessage: JsMessage): ProcessResult {
259+
return SendToConsumer
260+
}
261+
262+
override val method: String = "globalMethod"
263+
},
264+
)
261265
}
262266
}
263267
}

0 commit comments

Comments
 (0)