cleanup and test impl

AwkwardPeak7 2 years ago committed by Koitharu
parent 4edcd70871
commit a0f9bc032d

@ -59,7 +59,6 @@ dependencies {
api 'org.jsoup:jsoup:1.17.2' api 'org.jsoup:jsoup:1.17.2'
implementation 'org.json:json:20240303' implementation 'org.json:json:20240303'
implementation 'androidx.collection:collection:1.4.0' implementation 'androidx.collection:collection:1.4.0'
implementation 'org.jetbrains.kotlinx:kotlinx-io-core:0.3.4'
ksp project(':kotatsu-parsers-ksp') ksp project(':kotatsu-parsers-ksp')

@ -45,6 +45,9 @@ abstract class MangaLoaderContext {
redraw: (image: Bitmap) -> Bitmap redraw: (image: Bitmap) -> Bitmap
): Response ): Response
/**
* create a new empty Bitmap with given dimensions
*/
abstract fun createBitmap( abstract fun createBitmap(
width: Int, width: Int,
height: Int height: Int

@ -4,6 +4,7 @@ import com.koushikdutta.quack.QuackContext
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.koitharu.kotatsu.parsers.bitmap.Bitmap
import org.koitharu.kotatsu.parsers.config.MangaSourceConfig import org.koitharu.kotatsu.parsers.config.MangaSourceConfig
import org.koitharu.kotatsu.parsers.model.MangaSource import org.koitharu.kotatsu.parsers.model.MangaSource
import org.koitharu.kotatsu.parsers.network.UserAgents import org.koitharu.kotatsu.parsers.network.UserAgents
@ -45,6 +46,14 @@ internal object MangaLoaderContextMock : MangaLoaderContext() {
override fun getDefaultUserAgent(): String = UserAgents.FIREFOX_MOBILE 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 { suspend fun doRequest(url: String, source: MangaSource?): Response {
val request = Request.Builder() val request = Request.Builder()
.get() .get()

Loading…
Cancel
Save