From 96e31c83a5b44a69b939366875996cbfa05100ec Mon Sep 17 00:00:00 2001 From: Tyler Freeman Date: Thu, 27 Jul 2023 09:02:32 -0700 Subject: [PATCH] fix(bold text test): reset settings when test finishes Fix: 293250385 Test: atest packages/apps/Settings/tests/unit/src/com/android/settings/accessibility/FontWeightAdjustmentPreferenceControllerTest.java Change-Id: Ie1917799f9619157ce5e32997bd3798c68da085b --- ...ontWeightAdjustmentPreferenceControllerTest.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/unit/src/com/android/settings/accessibility/FontWeightAdjustmentPreferenceControllerTest.java b/tests/unit/src/com/android/settings/accessibility/FontWeightAdjustmentPreferenceControllerTest.java index 3e0670a70f1..9a6bf706628 100644 --- a/tests/unit/src/com/android/settings/accessibility/FontWeightAdjustmentPreferenceControllerTest.java +++ b/tests/unit/src/com/android/settings/accessibility/FontWeightAdjustmentPreferenceControllerTest.java @@ -27,8 +27,8 @@ import androidx.test.ext.junit.runners.AndroidJUnit4; import com.android.settings.core.BasePreferenceController; +import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -52,15 +52,18 @@ public class FontWeightAdjustmentPreferenceControllerTest { mContext, "font_weight_adjustment"); } + @After + public void teardown() { + Settings.Secure.resetToDefaults(mContext.getContentResolver(), /* tag= */ null); + } + @Test - @Ignore("modifies system-wide fontscale, but doesn't reset it. b/293250385") public void getAvailabilityStatus_byDefault_shouldReturnAvailable() { assertThat(mController.getAvailabilityStatus()).isEqualTo( BasePreferenceController.AVAILABLE); } @Test - @Ignore("modifies system-wide fontscale, but doesn't reset it. b/293250385") public void isChecked_enabledBoldText_shouldReturnTrue() { Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.FONT_WEIGHT_ADJUSTMENT, ON); @@ -72,7 +75,6 @@ public class FontWeightAdjustmentPreferenceControllerTest { } @Test - @Ignore("modifies system-wide fontscale, but doesn't reset it. b/293250385") public void isChecked_disabledBoldText_shouldReturnFalse() { Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.FONT_WEIGHT_ADJUSTMENT, OFF); @@ -84,7 +86,6 @@ public class FontWeightAdjustmentPreferenceControllerTest { } @Test - @Ignore("modifies system-wide fontscale, but doesn't reset it. b/293250385") public void setChecked_setTrue_shouldEnableBoldText() { mController.setChecked(true); @@ -93,7 +94,6 @@ public class FontWeightAdjustmentPreferenceControllerTest { } @Test - @Ignore("modifies system-wide fontscale, but doesn't reset it. b/293250385") public void setChecked_setFalse_shouldDisableBoldText() { mController.setChecked(false); @@ -102,7 +102,6 @@ public class FontWeightAdjustmentPreferenceControllerTest { } @Test - @Ignore("modifies system-wide fontscale, but doesn't reset it. b/293250385") public void resetState_shouldDisableBoldText() { mController.setChecked(true);