Skip to content
Snippets Groups Projects
Commit ff514d4a authored by Shivansh Saini's avatar Shivansh Saini Committed by Geoffrey Métais
Browse files

UI test: Fix compiler errors

parent 8fa7c858
No related branches found
No related tags found
1 merge request!214GSoC'19 | Unit & UI tests
......@@ -35,6 +35,7 @@ import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.videolan.libvlc.Media
import org.videolan.libvlc.interfaces.IMedia
import org.videolan.vlc.VLCApplication
import org.videolan.vlc.database.helpers.*
import org.videolan.vlc.database.models.BrowserFav
......@@ -76,7 +77,7 @@ class MigrationTest {
createNetworkFavsTable(sqliteTestDbOpenHelper)
// Insert Data before migration
saveSlave(slaveMedia1Path, Media.Slave.Type.Subtitle, 2, slaveMedia1UriFa, sqliteTestDbOpenHelper)
saveSlave(slaveMedia1Path, IMedia.Slave.Type.Subtitle, 2, slaveMedia1UriFa, sqliteTestDbOpenHelper)
saveExSubtitle(exSubfile1Sub1, exSubMedia1Name, sqliteTestDbOpenHelper)
saveNetworkFavItem(favUri, favTitle, null, sqliteTestDbOpenHelper)
......@@ -89,7 +90,7 @@ class MigrationTest {
val fav: BrowserFav = migratedDb.browserFavDao().get(favUri)[0]
assertEquals(slave.mediaPath, slaveMedia1Path)
assertEquals(slave.type, Media.Slave.Type.Subtitle)
assertEquals(slave.type, IMedia.Slave.Type.Subtitle)
assertEquals(slave.priority, 2)
assertEquals(slave.uri, slaveMedia1UriFa)
......
......@@ -131,16 +131,6 @@ class PreferencesUIUITest: BasePreferenceUITest() {
assertThat(intentsTestRule.activityResult.resultCode, equalTo(RESULT_RESTART))
}
@Test
fun checkAudioCardSetting_dueRestart() {
val key = KEY_AUDIO_SHOW_CARDS
checkToggleWorks(key, settings)
intentsTestRule.finishActivity()
assertThat(intentsTestRule.activityResult.resultCode, equalTo(RESULT_RESTART))
}
@Test
fun checkAudioCoverBlurredBackgroundSetting() {
val key = "blurred_cover_background"
......@@ -169,19 +159,8 @@ class PreferencesUIUITest: BasePreferenceUITest() {
checkToggleWorks(key, settings)
}
@Test
fun checkAudioTitleAlignmentMode() {
val key = "audio_title_alignment"
checkModeChanged(key, "0", "0", MAP_AUDIO_TITLE_ALIGN)
checkModeChanged(key, "1", "0", MAP_AUDIO_TITLE_ALIGN)
checkModeChanged(key, "2", "0", MAP_AUDIO_TITLE_ALIGN)
checkModeChanged(key, "3", "0", MAP_AUDIO_TITLE_ALIGN)
}
companion object {
val MAP_DAYNIGHT_MODE = mapOf("-1" to R.string.daynight_follow_system_title, "0" to R.string.daynight_title, "1" to R.string.light_theme, "2" to R.string.enable_black_theme)
val MAP_GROUP_VIDEOS = mapOf("-1" to R.string.video_min_group_length_disable, "0" to R.string.video_min_group_length_folder)
val MAP_AUDIO_TITLE_ALIGN = mapOf("0" to R.string.audio_title_alignment_default, "1" to R.string.audio_title_alignment_left, "2" to R.string.audio_title_alignment_right, "3" to R.string.audio_title_alignment_marquee)
}
}
\ No newline at end of file
package org.videolan.vlc.util
import org.junit.runners.model.FrameworkMethod
import org.junit.runners.model.InitializationError
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import org.robolectric.internal.SandboxTestRunner
import org.robolectric.internal.bytecode.Sandbox
import java.lang.reflect.Method
class RoboLiteTestRunner(cls: Class<*>) : RobolectricTestRunner(cls) {
override fun beforeTest(sandbox: Sandbox?, method: FrameworkMethod?, bootstrappedMethod: Method?) {
}
override fun afterTest(method: FrameworkMethod?, bootstrappedMethod: Method?) {
}
override fun getHelperTestRunner(bootstrappedTestClass: Class<*>?): SandboxTestRunner.HelperTestRunner {
try {
return SandboxTestRunner.HelperTestRunner(bootstrappedTestClass)
} catch (initializationError: InitializationError) {
throw RuntimeException(initializationError)
}
}
override fun buildGlobalConfig(): Config {
return Config.Builder().setManifest(Config.NONE).build()
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment