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
This commit is contained in:
@@ -27,8 +27,8 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
|
|||||||
|
|
||||||
import com.android.settings.core.BasePreferenceController;
|
import com.android.settings.core.BasePreferenceController;
|
||||||
|
|
||||||
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
@@ -52,15 +52,18 @@ public class FontWeightAdjustmentPreferenceControllerTest {
|
|||||||
mContext, "font_weight_adjustment");
|
mContext, "font_weight_adjustment");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@After
|
||||||
|
public void teardown() {
|
||||||
|
Settings.Secure.resetToDefaults(mContext.getContentResolver(), /* tag= */ null);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("modifies system-wide fontscale, but doesn't reset it. b/293250385")
|
|
||||||
public void getAvailabilityStatus_byDefault_shouldReturnAvailable() {
|
public void getAvailabilityStatus_byDefault_shouldReturnAvailable() {
|
||||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(
|
assertThat(mController.getAvailabilityStatus()).isEqualTo(
|
||||||
BasePreferenceController.AVAILABLE);
|
BasePreferenceController.AVAILABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("modifies system-wide fontscale, but doesn't reset it. b/293250385")
|
|
||||||
public void isChecked_enabledBoldText_shouldReturnTrue() {
|
public void isChecked_enabledBoldText_shouldReturnTrue() {
|
||||||
Settings.Secure.putInt(mContext.getContentResolver(),
|
Settings.Secure.putInt(mContext.getContentResolver(),
|
||||||
Settings.Secure.FONT_WEIGHT_ADJUSTMENT, ON);
|
Settings.Secure.FONT_WEIGHT_ADJUSTMENT, ON);
|
||||||
@@ -72,7 +75,6 @@ public class FontWeightAdjustmentPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("modifies system-wide fontscale, but doesn't reset it. b/293250385")
|
|
||||||
public void isChecked_disabledBoldText_shouldReturnFalse() {
|
public void isChecked_disabledBoldText_shouldReturnFalse() {
|
||||||
Settings.Secure.putInt(mContext.getContentResolver(),
|
Settings.Secure.putInt(mContext.getContentResolver(),
|
||||||
Settings.Secure.FONT_WEIGHT_ADJUSTMENT, OFF);
|
Settings.Secure.FONT_WEIGHT_ADJUSTMENT, OFF);
|
||||||
@@ -84,7 +86,6 @@ public class FontWeightAdjustmentPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("modifies system-wide fontscale, but doesn't reset it. b/293250385")
|
|
||||||
public void setChecked_setTrue_shouldEnableBoldText() {
|
public void setChecked_setTrue_shouldEnableBoldText() {
|
||||||
mController.setChecked(true);
|
mController.setChecked(true);
|
||||||
|
|
||||||
@@ -93,7 +94,6 @@ public class FontWeightAdjustmentPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("modifies system-wide fontscale, but doesn't reset it. b/293250385")
|
|
||||||
public void setChecked_setFalse_shouldDisableBoldText() {
|
public void setChecked_setFalse_shouldDisableBoldText() {
|
||||||
mController.setChecked(false);
|
mController.setChecked(false);
|
||||||
|
|
||||||
@@ -102,7 +102,6 @@ public class FontWeightAdjustmentPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("modifies system-wide fontscale, but doesn't reset it. b/293250385")
|
|
||||||
public void resetState_shouldDisableBoldText() {
|
public void resetState_shouldDisableBoldText() {
|
||||||
mController.setChecked(true);
|
mController.setChecked(true);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user