Commit a4bf2b95 authored by Shivansh Saini's avatar Shivansh Saini

Tests: Fixed LibVLC refactored references

parent d150b67c
......@@ -22,6 +22,7 @@ package org.videolan.vlc.util
import android.net.Uri
import org.videolan.libvlc.Media
import org.videolan.libvlc.interfaces.IMedia
import org.videolan.vlc.api.OpenSubtitle
import org.videolan.vlc.api.QueryParameters
import org.videolan.vlc.database.models.BrowserFav
......@@ -86,7 +87,7 @@ object TestUtil {
}
fun createSubtitleSlave(mediaPath: String, uri: String): Slave {
return Slave(mediaPath, Media.Slave.Type.Subtitle, 2, uri)
return Slave(mediaPath, IMedia.Slave.Type.Subtitle, 2, uri)
}
fun createSubtitleSlavesForMedia(mediaName: String, count: Int): List<Slave> {
......
......@@ -4,10 +4,10 @@ import android.app.Application
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.ObsoleteCoroutinesApi
import org.videolan.libvlc.FactoryManager
import org.videolan.libvlc.ILibVLCFactory
import org.videolan.libvlc.IMediaFactory
import org.videolan.libvlc.test.TestLibVLCFactory
import org.videolan.libvlc.test.TestMediaFactory
import org.videolan.libvlc.interfaces.ILibVLCFactory
import org.videolan.libvlc.interfaces.IMediaFactory
import org.videolan.libvlc.stubs.StubLibVLCFactory
import org.videolan.libvlc.stubs.StubMediaFactory
import org.videolan.medialibrary.MLServiceLocator
@ExperimentalCoroutinesApi
......@@ -15,7 +15,7 @@ import org.videolan.medialibrary.MLServiceLocator
class VLCTestApplication : Application() {
init {
MLServiceLocator.setLocatorMode(MLServiceLocator.LocatorMode.TESTS)
FactoryManager.registerFactory(IMediaFactory.factoryId, TestMediaFactory())
FactoryManager.registerFactory(ILibVLCFactory.factoryId, TestLibVLCFactory())
FactoryManager.registerFactory(IMediaFactory.factoryId, StubMediaFactory())
FactoryManager.registerFactory(ILibVLCFactory.factoryId, StubLibVLCFactory())
}
}
\ No newline at end of file
......@@ -14,8 +14,8 @@ import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
import org.videolan.libvlc.LibVLC
import org.videolan.libvlc.Media
import org.videolan.libvlc.test.TestMedia
import org.videolan.libvlc.interfaces.IMedia
import org.videolan.libvlc.stubs.StubMedia
import org.videolan.libvlc.util.MediaBrowser
import org.videolan.medialibrary.interfaces.media.AbstractMediaWrapper
import org.videolan.vlc.BaseTest
......@@ -79,7 +79,7 @@ class FileBrowserModelTest : BaseTest() {
}
private fun addFileToProvider(i: Int, file: File) {
val t = TestMedia(mockedLibVlc, "file://${file.path}").apply { if (!file.name.endsWith(".mp4")) type = Media.Type.Directory }
val t = StubMedia(mockedLibVlc, "file://${file.path}").apply { if (!file.name.endsWith(".mp4")) type = IMedia.Type.Directory }
browserProvider.onMediaAdded(i, t)
}
......
......@@ -12,7 +12,8 @@ import org.junit.Test
import org.junit.rules.TemporaryFolder
import org.videolan.libvlc.LibVLC
import org.videolan.libvlc.Media
import org.videolan.libvlc.test.TestMedia
import org.videolan.libvlc.interfaces.IMedia
import org.videolan.libvlc.stubs.StubMedia
import org.videolan.libvlc.util.MediaBrowser
import org.videolan.vlc.BaseTest
import org.videolan.vlc.providers.BrowserProvider
......@@ -64,7 +65,7 @@ class FilePickerModelTest : BaseTest() {
}
private fun addFileToProvider(i: Int, file: File) {
val t = TestMedia(mockedLibVlc, "file://${file.path}").apply { if (!file.name.endsWith(".mp4")) type = Media.Type.Directory }
val t = StubMedia(mockedLibVlc, "file://${file.path}").apply { if (!file.name.endsWith(".mp4")) type = IMedia.Type.Directory }
browserProvider.onMediaAdded(i, t)
}
......
......@@ -14,8 +14,8 @@ import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
import org.videolan.libvlc.LibVLC
import org.videolan.libvlc.Media
import org.videolan.libvlc.test.TestMedia
import org.videolan.libvlc.interfaces.IMedia
import org.videolan.libvlc.stubs.StubMedia
import org.videolan.libvlc.util.MediaBrowser
import org.videolan.medialibrary.Medialibrary
import org.videolan.vlc.BaseTest
......@@ -92,7 +92,7 @@ class StorageModelTest : BaseTest() {
private fun addFileToProvider(i: Int, file: File) {
if (file.name.startsWith(".") && !showHiddenFiles)
return
val t = TestMedia(mockedLibVlc, "file://${file.path}").apply { if (!file.name.endsWith(".mp4")) type = Media.Type.Directory }
val t = StubMedia(mockedLibVlc, "file://${file.path}").apply { if (!file.name.endsWith(".mp4")) type = IMedia.Type.Directory }
browserProvider.onMediaAdded(i, t)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment