android-test icon indicating copy to clipboard operation
android-test copied to clipboard

Activity Scenario `launch` function in the `1.5.0-alpha02` release sets flags on passed in Intent

Open jbw0033 opened this issue 3 years ago • 1 comments

Description

In the Navigation library of AndroidX there are tests that use the ActivityScenario.launch(Intent) function in order to start an activity in the test environment. When upgrading to androidx.test:core:1.5.0-alpha02 those tests started to fail and after investigation it was found that the new launch function caused this check in Navigation to be true. In a real world scenario, the flag is not set unless done so explicitly by the user.

Steps to Reproduce

Launch an activity from an intent using the launch function and check the flags of the activity's intent.

Expected Results

Either no extras flags are set on the intent, or the same flags that used to be set are still set.

Actual Results

New flag is set on the intent.

AndroidX Test and Android OS Versions

1.5.0-alpha02 and API 29 (but fails on all of them)

jbw0033 avatar Aug 31 '22 17:08 jbw0033

Probably caused by this line:

https://github.com/android/android-test/commit/cfd3a9facaffd28dc074e920d533fe4283d29a41#diff-a5dff1a88413274bad1d9628465e84c19dc4ce39ede38e6eaf47467fbed707d8R406

I became aware of it from https://github.com/android/android-test/issues/1454#issuecomment-1227553260.

TWiStErRob avatar Aug 31 '22 22:08 TWiStErRob