Skip to content

Commit

Permalink
Reactivate Session Replay instrumented test for API 21
Browse files Browse the repository at this point in the history
  • Loading branch information
ambushwork committed Oct 24, 2024
1 parent d13c96a commit d5adb23
Show file tree
Hide file tree
Showing 18 changed files with 7 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ open class LegacyDrawableToColorMapper : DrawableToColorMapper {

if (fillPaint == null) return null
val filterColor = try {
mColorField?.get(fillPaint.colorFilter) as? Int ?: fillPaint.color
fillPaint.colorFilter?.let {
mColorField?.get(it) as? Int
} ?: fillPaint.color
} catch (e: IllegalArgumentException) {
internalLogger.log(
InternalLogger.Level.WARN,
Expand Down Expand Up @@ -155,7 +157,7 @@ open class LegacyDrawableToColorMapper : DrawableToColorMapper {
* @return the color to map to or null if not applicable
*/
protected open fun resolveInsetDrawable(drawable: InsetDrawable, internalLogger: InternalLogger): Int? {
return null
return drawable.drawable?.let { mapDrawableToColor(it, internalLogger) }
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.rules.SessionReplayTestRule
import org.junit.Rule
Expand All @@ -22,9 +20,7 @@ internal class ConsentGrantedSrTest : BaseSessionReplayTest<SessionReplayPlaygro
keepRequests = true
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.chekboxandradio

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplayRadioCheckboxFieldsActivity
Expand All @@ -28,9 +26,7 @@ internal class SrCheckBoxAndRadioFieldsAllowTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.ALLOW)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.chekboxandradio

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplayRadioCheckboxFieldsActivity
Expand All @@ -28,9 +26,7 @@ internal class SrCheckBoxAndRadioFieldsMaskTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.chekboxandradio

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplayRadioCheckboxFieldsActivity
Expand All @@ -28,9 +26,7 @@ internal class SrCheckBoxAndRadioFieldsMaskUserInputTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK_USER_INPUT)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.imagebuttons

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImageButtonsActivity
Expand All @@ -28,9 +26,7 @@ internal class SrImageButtonsAllowTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.ALLOW)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.imagebuttons

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImageButtonsActivity
Expand All @@ -28,9 +26,7 @@ internal class SrImageButtonsMaskTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.imagebuttons

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImageButtonsActivity
Expand All @@ -28,9 +26,7 @@ internal class SrImageButtonsMaskUserInputTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK_USER_INPUT)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.images

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImagesActivity
Expand All @@ -28,9 +26,7 @@ internal class SrImagesAllowTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.ALLOW)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.images

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImagesActivity
Expand All @@ -28,9 +26,7 @@ internal class SrImagesMaskTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.images

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImagesActivity
Expand All @@ -28,9 +26,7 @@ internal class SrImagesMaskUserInputTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK_USER_INPUT)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.sensitivefields

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplaySensitiveFieldsActivity
Expand All @@ -27,9 +25,7 @@ internal class SrSensitiveFieldsAllowTest : BaseSessionReplayTest<SessionReplayS
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.ALLOW)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.sensitivefields

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplaySensitiveFieldsActivity
Expand All @@ -27,9 +25,7 @@ internal class SrSensitiveFieldsMaskTest : BaseSessionReplayTest<SessionReplaySe
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.sensitivefields

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplaySensitiveFieldsActivity
Expand All @@ -27,9 +25,7 @@ internal class SrSensitiveFieldsMaskUserInputTest : BaseSessionReplayTest<Sessio
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK_USER_INPUT)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ internal class SrTextFieldsAllowTest : BaseSessionReplayTest<SessionReplayTextFi
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.ALLOW)
)

// TODO RUM-6839: Fix test on API 21
// TODO RUM-6839: Fix test on API 21, the test failure is caused by different drawable
// on the text background among API versions. the background wireframes on higher version are
// images, on lower version are shapes.
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.textfields

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplayTextFieldsActivity
Expand All @@ -27,9 +25,7 @@ internal class SrTextFieldsMaskTest : BaseSessionReplayTest<SessionReplayTextFie
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.textfields

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplayTextFieldsActivity
Expand All @@ -27,9 +25,7 @@ internal class SrTextFieldsMaskUserInputTest : BaseSessionReplayTest<SessionRepl
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK_USER_INPUT)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package com.datadog.android.sdk.integration.sessionreplay.textfields

import android.os.Build
import androidx.test.filters.SdkSuppress
import com.datadog.android.privacy.TrackingConsent
import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest
import com.datadog.android.sdk.integration.sessionreplay.SessionReplayTextFieldsWithInputActivity
Expand All @@ -28,9 +26,7 @@ internal class SrTextFieldsWithInputMaskUserInputTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK_USER_INPUT)
)

// TODO RUM-6839: Fix test on API 21
@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down

0 comments on commit d5adb23

Please sign in to comment.