cleanup and test impl
This commit is contained in:
@@ -59,7 +59,6 @@ dependencies {
|
||||
api 'org.jsoup:jsoup:1.17.2'
|
||||
implementation 'org.json:json:20240303'
|
||||
implementation 'androidx.collection:collection:1.4.0'
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-io-core:0.3.4'
|
||||
|
||||
ksp project(':kotatsu-parsers-ksp')
|
||||
|
||||
|
||||
@@ -45,6 +45,9 @@ abstract class MangaLoaderContext {
|
||||
redraw: (image: Bitmap) -> Bitmap
|
||||
): Response
|
||||
|
||||
/**
|
||||
* create a new empty Bitmap with given dimensions
|
||||
*/
|
||||
abstract fun createBitmap(
|
||||
width: Int,
|
||||
height: Int
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.koushikdutta.quack.QuackContext
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.koitharu.kotatsu.parsers.bitmap.Bitmap
|
||||
import org.koitharu.kotatsu.parsers.config.MangaSourceConfig
|
||||
import org.koitharu.kotatsu.parsers.model.MangaSource
|
||||
import org.koitharu.kotatsu.parsers.network.UserAgents
|
||||
@@ -45,6 +46,14 @@ internal object MangaLoaderContextMock : MangaLoaderContext() {
|
||||
|
||||
override fun getDefaultUserAgent(): String = UserAgents.FIREFOX_MOBILE
|
||||
|
||||
override fun redrawImageResponse(response: Response, redraw: (image: Bitmap) -> Bitmap): Response {
|
||||
return response
|
||||
}
|
||||
|
||||
override fun createBitmap(width: Int, height: Int): Bitmap {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
suspend fun doRequest(url: String, source: MangaSource?): Response {
|
||||
val request = Request.Builder()
|
||||
.get()
|
||||
|
||||
Reference in New Issue
Block a user