[Android] UI test: Fix compiler errors
Shivansh Saini
git at videolan.org
Mon Dec 16 17:52:56 CET 2019
vlc-android | branch: master | Shivansh Saini <shivanshs9 at gmail.com> | Tue Aug 27 09:35:24 2019 +0530| [ff514d4a911899e104ba4b5cb25624972f2c1c20] | committer: Geoffrey Métais
UI test: Fix compiler errors
> https://code.videolan.org/videolan/vlc-android/commit/ff514d4a911899e104ba4b5cb25624972f2c1c20
---
.../org/videolan/vlc/database/MigrationTest.kt | 5 ++--
.../vlc/gui/preferences/PreferencesUIUITest.kt | 21 --------------
.../org/videolan/vlc/util/RoboLiteTestRunner.kt | 32 ----------------------
3 files changed, 3 insertions(+), 55 deletions(-)
diff --git a/vlc-android/androidTest/org/videolan/vlc/database/MigrationTest.kt b/vlc-android/androidTest/org/videolan/vlc/database/MigrationTest.kt
index 366d91ac2..d8c32929d 100644
--- a/vlc-android/androidTest/org/videolan/vlc/database/MigrationTest.kt
+++ b/vlc-android/androidTest/org/videolan/vlc/database/MigrationTest.kt
@@ -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)
diff --git a/vlc-android/androidTest/org/videolan/vlc/gui/preferences/PreferencesUIUITest.kt b/vlc-android/androidTest/org/videolan/vlc/gui/preferences/PreferencesUIUITest.kt
index c06313e50..6991b0d04 100644
--- a/vlc-android/androidTest/org/videolan/vlc/gui/preferences/PreferencesUIUITest.kt
+++ b/vlc-android/androidTest/org/videolan/vlc/gui/preferences/PreferencesUIUITest.kt
@@ -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
diff --git a/vlc-android/test-common/org/videolan/vlc/util/RoboLiteTestRunner.kt b/vlc-android/test-common/org/videolan/vlc/util/RoboLiteTestRunner.kt
deleted file mode 100644
index 1789df2a5..000000000
--- a/vlc-android/test-common/org/videolan/vlc/util/RoboLiteTestRunner.kt
+++ /dev/null
@@ -1,32 +0,0 @@
-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()
- }
-}
-
More information about the Android
mailing list