[components] Merge https://github.com/mozilla-mobile/android-components/pull/7160 https://github.com/mozilla-mobile/android-components/pull/7196 (part 2)
7160: Closes https://github.com/mozilla-mobile/android-components/issues/7142: Sanitize url in HttpIconLoader r=pocmo a=Amejia481 7196: Closes https://github.com/mozilla-mobile/android-components/issues/7176: Add to the configuration file for instrumentation tests components that use Room r=gabrielluong,pocmo,isabelrios a=Amejia481 Closes https://github.com/mozilla-mobile/android-components/issues/7176 Co-authored-by: Arturo Mejia <arturomejiamarmol@gmail.com>
This commit is contained in:
@@ -84,8 +84,15 @@ samples=${component//samples-}
|
||||
if [[ "${component}" != samples-* ]]
|
||||
then
|
||||
# Case 1: tests for any component (but NOT samples, NOT real UI tests)
|
||||
APK_APP="./samples/${component}/build/outputs/apk/geckoNightly/debug/samples-${component}-geckoNightly-debug.apk"
|
||||
APK_TEST="./components/${component}/engine-gecko-nightly/build/outputs/apk/androidTest/debug/browser-engine-gecko-nightly-debug-androidTest.apk"
|
||||
APK_APP="./samples/browser/build/outputs/apk/geckoNightly/debug/samples-browser-geckoNightly-debug.apk"
|
||||
if [[ "${component}" == *"-"* ]]
|
||||
then
|
||||
regex='([a-z]*)-(.*)'
|
||||
[[ "$component" =~ $regex ]]
|
||||
APK_TEST="./components/${BASH_REMATCH[1]}/${BASH_REMATCH[2]}/build/outputs/apk/androidTest/debug/${component}-debug-androidTest.apk"
|
||||
else
|
||||
APK_TEST="./components/${component}/engine-gecko-nightly/build/outputs/apk/androidTest/debug/browser-engine-gecko-nightly-debug-androidTest.apk"
|
||||
fi
|
||||
elif [[ "${component}" == "samples-browser" ]]
|
||||
then
|
||||
# Case 2: tests for browser sample (geckoNightly sample only)
|
||||
|
||||
@@ -144,7 +144,7 @@ class TopSiteStorageTest {
|
||||
execSQL(
|
||||
"INSERT INTO " +
|
||||
"top_sites " +
|
||||
"(title, url, isDefault, created_at) " +
|
||||
"(title, url, is_default, created_at) " +
|
||||
"VALUES " +
|
||||
"('Firefox','firefox.com',1,5)," +
|
||||
"('Monitor','https://monitor.firefox.com/',0,5)"
|
||||
@@ -154,29 +154,29 @@ class TopSiteStorageTest {
|
||||
dbVersion2.query("SELECT * FROM top_sites").use { cursor ->
|
||||
assertEquals(5, cursor.columnCount)
|
||||
|
||||
// Check isDefault for Mozilla
|
||||
// Check is_default for Mozilla
|
||||
cursor.moveToFirst()
|
||||
assertEquals(0, cursor.getInt(cursor.getColumnIndexOrThrow("isDefault")))
|
||||
assertEquals(0, cursor.getInt(cursor.getColumnIndexOrThrow("is_default")))
|
||||
|
||||
// Check isDefault for Top Articles
|
||||
// Check is_default for Top Articles
|
||||
cursor.moveToNext()
|
||||
assertEquals(1, cursor.getInt(cursor.getColumnIndexOrThrow("isDefault")))
|
||||
assertEquals(1, cursor.getInt(cursor.getColumnIndexOrThrow("is_default")))
|
||||
|
||||
// Check isDefault for Wikipedia
|
||||
// Check is_default for Wikipedia
|
||||
cursor.moveToNext()
|
||||
assertEquals(1, cursor.getInt(cursor.getColumnIndexOrThrow("isDefault")))
|
||||
assertEquals(1, cursor.getInt(cursor.getColumnIndexOrThrow("is_default")))
|
||||
|
||||
// Check isDefault for YouTube
|
||||
// Check is_default for YouTube
|
||||
cursor.moveToNext()
|
||||
assertEquals(1, cursor.getInt(cursor.getColumnIndexOrThrow("isDefault")))
|
||||
assertEquals(1, cursor.getInt(cursor.getColumnIndexOrThrow("is_default")))
|
||||
|
||||
// Check isDefault for Firefox
|
||||
// Check is_default for Firefox
|
||||
cursor.moveToNext()
|
||||
assertEquals(1, cursor.getInt(cursor.getColumnIndexOrThrow("isDefault")))
|
||||
assertEquals(1, cursor.getInt(cursor.getColumnIndexOrThrow("is_default")))
|
||||
|
||||
// Check isDefault for Monitor
|
||||
// Check is_default for Monitor
|
||||
cursor.moveToNext()
|
||||
assertEquals(0, cursor.getInt(cursor.getColumnIndexOrThrow("isDefault")))
|
||||
assertEquals(0, cursor.getInt(cursor.getColumnIndexOrThrow("is_default")))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,16 +44,16 @@ internal abstract class TopSiteDatabase : RoomDatabase() {
|
||||
internal object Migrations {
|
||||
val migration_1_2 = object : Migration(1, 2) {
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
// Add the new isDefault column and set isDefault to 0 (false) for every entry.
|
||||
// Add the new is_default column and set is_default to 0 (false) for every entry.
|
||||
database.execSQL(
|
||||
"ALTER TABLE top_sites ADD COLUMN isDefault INTEGER NOT NULL DEFAULT 0"
|
||||
"ALTER TABLE top_sites ADD COLUMN is_default INTEGER NOT NULL DEFAULT 0"
|
||||
)
|
||||
|
||||
// Prior to version 2, pocket top sites, wikipedia and youtube were added as default
|
||||
// sites in Fenix. Look for these entries and set isDefault to 1 (true).
|
||||
// sites in Fenix. Look for these entries and set is_default to 1 (true).
|
||||
database.execSQL(
|
||||
"UPDATE top_sites " +
|
||||
"SET isDefault = 1 " +
|
||||
"SET is_default = 1 " +
|
||||
"WHERE url IN " +
|
||||
"('https://getpocket.com/fenix-top-articles', " +
|
||||
"'https://www.wikipedia.org/', " +
|
||||
|
||||
@@ -70,3 +70,24 @@ jobs:
|
||||
- ['automation/taskcluster/androidTest/ui-test.sh', 'samples-glean', 'arm', '1']
|
||||
treeherder:
|
||||
symbol: 'ui-samples-glean'
|
||||
android-feature-pwa:
|
||||
description: 'Run unit tests on device for feature pwa'
|
||||
run:
|
||||
post-gradlew:
|
||||
- ['automation/taskcluster/androidTest/ui-test.sh', 'feature-pwa', 'arm', '1']
|
||||
treeherder:
|
||||
symbol: 'unit-feature-pwa'
|
||||
android-feature-sitepermissions:
|
||||
description: 'Run unit tests on device for feature site permissions'
|
||||
run:
|
||||
post-gradlew:
|
||||
- ['automation/taskcluster/androidTest/ui-test.sh', 'feature-sitepermissions', 'arm', '1']
|
||||
treeherder:
|
||||
symbol: 'unit-sitepermissions'
|
||||
android-feature-top-sites:
|
||||
description: 'Run unit tests on device for feature top sites'
|
||||
run:
|
||||
post-gradlew:
|
||||
- ['automation/taskcluster/androidTest/ui-test.sh', 'feature-top-sites', 'arm', '1']
|
||||
treeherder:
|
||||
symbol: 'unit-feature-top-sites'
|
||||
Reference in New Issue
Block a user