diff options
author | Googler <noreply@google.com> | 2024-04-09 14:48:10 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-04-09 14:48:49 -0700 |
commit | d525b84ecbd51c5c280e00af844b000986efd481 (patch) | |
tree | de4b3f2903a8b0c48c8d658f99713d32de962201 /robolectric | |
parent | c4ee6e00019aae33fc3bae87b1ece6216282562f (diff) | |
download | robolectric-d525b84ecbd51c5c280e00af844b000986efd481.tar.gz |
Add isDataRoamingEnabled to the ShadowTelephonyManager.
This change allows us to toggle isDataRoamingEnabled to match the real TelephonyManger, for the sake of testing.
PiperOrigin-RevId: 623287070
Diffstat (limited to 'robolectric')
-rw-r--r-- | robolectric/src/test/java/org/robolectric/shadows/ShadowTelephonyManagerTest.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/robolectric/src/test/java/org/robolectric/shadows/ShadowTelephonyManagerTest.java b/robolectric/src/test/java/org/robolectric/shadows/ShadowTelephonyManagerTest.java index 460ceca99..6da61d037 100644 --- a/robolectric/src/test/java/org/robolectric/shadows/ShadowTelephonyManagerTest.java +++ b/robolectric/src/test/java/org/robolectric/shadows/ShadowTelephonyManagerTest.java @@ -1503,4 +1503,13 @@ public class ShadowTelephonyManagerTest { assertThat(tm.getSubscriptionId()).isEqualTo(123); } + + @Test + @Config(minSdk = Q) + public void setDataRoamingEnabledChangesIsDataRoamingEnabled() { + shadowOf(telephonyManager).setDataRoamingEnabled(false); + assertThat(telephonyManager.isDataRoamingEnabled()).isFalse(); + shadowOf(telephonyManager).setDataRoamingEnabled(true); + assertThat(telephonyManager.isDataRoamingEnabled()).isTrue(); + } } |