Loading tests/robotests/src/com/android/settings/accessibility/CaptioningAppearancePreferenceControllerTest.java +17 −5 Original line number Diff line number Diff line Loading @@ -17,8 +17,10 @@ package com.android.settings.accessibility; import static com.google.common.truth.Truth.assertThat; import static org.robolectric.Shadows.shadowOf; import android.content.Context; import android.os.Looper; import android.provider.Settings; import android.view.accessibility.CaptioningManager; Loading Loading @@ -68,7 +70,9 @@ public class CaptioningAppearancePreferenceControllerTest { @Test public void getSummary_smallestScale_shouldReturnExpectedSummary() { mShadowCaptioningManager.setFontScale(0.25f); Settings.Secure.putFloat(mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE, 0.25f); shadowOf(Looper.getMainLooper()).idle(); final String expectedSummary = getSummaryCombo(/* fontScaleIndex= */ 0, DEFAULT_PRESET_INDEX); Loading @@ -77,7 +81,9 @@ public class CaptioningAppearancePreferenceControllerTest { @Test public void getSummary_smallScale_shouldReturnExpectedSummary() { mShadowCaptioningManager.setFontScale(0.5f); Settings.Secure.putFloat(mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE, 0.5f); shadowOf(Looper.getMainLooper()).idle(); final String expectedSummary = getSummaryCombo(/* fontScaleIndex= */ 1, DEFAULT_PRESET_INDEX); Loading @@ -86,7 +92,9 @@ public class CaptioningAppearancePreferenceControllerTest { @Test public void getSummary_mediumScale_shouldReturnExpectedSummary() { mShadowCaptioningManager.setFontScale(1.0f); Settings.Secure.putFloat(mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE, 1.0f); shadowOf(Looper.getMainLooper()).idle(); final String expectedSummary = getSummaryCombo(/* fontScaleIndex= */ 2, DEFAULT_PRESET_INDEX); Loading @@ -95,7 +103,9 @@ public class CaptioningAppearancePreferenceControllerTest { @Test public void getSummary_largeScale_shouldReturnExpectedSummary() { mShadowCaptioningManager.setFontScale(1.5f); Settings.Secure.putFloat(mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE, 1.5f); shadowOf(Looper.getMainLooper()).idle(); final String expectedSummary = getSummaryCombo(/* fontScaleIndex= */ 3, DEFAULT_PRESET_INDEX); Loading @@ -104,7 +114,9 @@ public class CaptioningAppearancePreferenceControllerTest { @Test public void getSummary_largestScale_shouldReturnExpectedSummary() { mShadowCaptioningManager.setFontScale(2.0f); Settings.Secure.putFloat(mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE, 2.0f); shadowOf(Looper.getMainLooper()).idle(); final String expectedSummary = getSummaryCombo(/* fontScaleIndex= */ 4, DEFAULT_PRESET_INDEX); Loading tests/robotests/src/com/android/settings/accessibility/CaptioningBackgroundColorControllerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -127,7 +127,8 @@ public class CaptioningBackgroundColorControllerTest { @Test public void onValueChanged_shouldSetCaptionEnabled() { mShadowCaptioningManager.setEnabled(false); Settings.Secure.putInt( mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, OFF); mController.displayPreference(mScreen); mController.onValueChanged(mPreference, 0xFFFF0000); Loading tests/robotests/src/com/android/settings/accessibility/CaptioningBackgroundOpacityControllerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -103,7 +103,8 @@ public class CaptioningBackgroundOpacityControllerTest { @Test public void onValueChanged_shouldSetCaptionEnabled() { mShadowCaptioningManager.setEnabled(false); Settings.Secure.putInt( mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, OFF); mController.displayPreference(mScreen); mController.onValueChanged(mPreference, 0x80FFFFFF); Loading tests/robotests/src/com/android/settings/accessibility/CaptioningEdgeColorControllerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,8 @@ public class CaptioningEdgeColorControllerTest { @Test public void onValueChanged_shouldSetCaptionEnabled() { mShadowCaptioningManager.setEnabled(false); Settings.Secure.putInt( mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, OFF); mController.displayPreference(mScreen); mController.onValueChanged(mPreference, 0xFFFF0000); Loading tests/robotests/src/com/android/settings/accessibility/CaptioningEdgeTypeControllerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -103,7 +103,8 @@ public class CaptioningEdgeTypeControllerTest { @Test public void onValueChanged_shouldSetCaptionEnabled() { mShadowCaptioningManager.setEnabled(false); Settings.Secure.putInt( mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, OFF); mController.displayPreference(mScreen); mController.onValueChanged(mPreference, CaptionStyle.EDGE_TYPE_OUTLINE); Loading Loading
tests/robotests/src/com/android/settings/accessibility/CaptioningAppearancePreferenceControllerTest.java +17 −5 Original line number Diff line number Diff line Loading @@ -17,8 +17,10 @@ package com.android.settings.accessibility; import static com.google.common.truth.Truth.assertThat; import static org.robolectric.Shadows.shadowOf; import android.content.Context; import android.os.Looper; import android.provider.Settings; import android.view.accessibility.CaptioningManager; Loading Loading @@ -68,7 +70,9 @@ public class CaptioningAppearancePreferenceControllerTest { @Test public void getSummary_smallestScale_shouldReturnExpectedSummary() { mShadowCaptioningManager.setFontScale(0.25f); Settings.Secure.putFloat(mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE, 0.25f); shadowOf(Looper.getMainLooper()).idle(); final String expectedSummary = getSummaryCombo(/* fontScaleIndex= */ 0, DEFAULT_PRESET_INDEX); Loading @@ -77,7 +81,9 @@ public class CaptioningAppearancePreferenceControllerTest { @Test public void getSummary_smallScale_shouldReturnExpectedSummary() { mShadowCaptioningManager.setFontScale(0.5f); Settings.Secure.putFloat(mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE, 0.5f); shadowOf(Looper.getMainLooper()).idle(); final String expectedSummary = getSummaryCombo(/* fontScaleIndex= */ 1, DEFAULT_PRESET_INDEX); Loading @@ -86,7 +92,9 @@ public class CaptioningAppearancePreferenceControllerTest { @Test public void getSummary_mediumScale_shouldReturnExpectedSummary() { mShadowCaptioningManager.setFontScale(1.0f); Settings.Secure.putFloat(mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE, 1.0f); shadowOf(Looper.getMainLooper()).idle(); final String expectedSummary = getSummaryCombo(/* fontScaleIndex= */ 2, DEFAULT_PRESET_INDEX); Loading @@ -95,7 +103,9 @@ public class CaptioningAppearancePreferenceControllerTest { @Test public void getSummary_largeScale_shouldReturnExpectedSummary() { mShadowCaptioningManager.setFontScale(1.5f); Settings.Secure.putFloat(mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE, 1.5f); shadowOf(Looper.getMainLooper()).idle(); final String expectedSummary = getSummaryCombo(/* fontScaleIndex= */ 3, DEFAULT_PRESET_INDEX); Loading @@ -104,7 +114,9 @@ public class CaptioningAppearancePreferenceControllerTest { @Test public void getSummary_largestScale_shouldReturnExpectedSummary() { mShadowCaptioningManager.setFontScale(2.0f); Settings.Secure.putFloat(mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE, 2.0f); shadowOf(Looper.getMainLooper()).idle(); final String expectedSummary = getSummaryCombo(/* fontScaleIndex= */ 4, DEFAULT_PRESET_INDEX); Loading
tests/robotests/src/com/android/settings/accessibility/CaptioningBackgroundColorControllerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -127,7 +127,8 @@ public class CaptioningBackgroundColorControllerTest { @Test public void onValueChanged_shouldSetCaptionEnabled() { mShadowCaptioningManager.setEnabled(false); Settings.Secure.putInt( mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, OFF); mController.displayPreference(mScreen); mController.onValueChanged(mPreference, 0xFFFF0000); Loading
tests/robotests/src/com/android/settings/accessibility/CaptioningBackgroundOpacityControllerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -103,7 +103,8 @@ public class CaptioningBackgroundOpacityControllerTest { @Test public void onValueChanged_shouldSetCaptionEnabled() { mShadowCaptioningManager.setEnabled(false); Settings.Secure.putInt( mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, OFF); mController.displayPreference(mScreen); mController.onValueChanged(mPreference, 0x80FFFFFF); Loading
tests/robotests/src/com/android/settings/accessibility/CaptioningEdgeColorControllerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,8 @@ public class CaptioningEdgeColorControllerTest { @Test public void onValueChanged_shouldSetCaptionEnabled() { mShadowCaptioningManager.setEnabled(false); Settings.Secure.putInt( mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, OFF); mController.displayPreference(mScreen); mController.onValueChanged(mPreference, 0xFFFF0000); Loading
tests/robotests/src/com/android/settings/accessibility/CaptioningEdgeTypeControllerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -103,7 +103,8 @@ public class CaptioningEdgeTypeControllerTest { @Test public void onValueChanged_shouldSetCaptionEnabled() { mShadowCaptioningManager.setEnabled(false); Settings.Secure.putInt( mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, OFF); mController.displayPreference(mScreen); mController.onValueChanged(mPreference, CaptionStyle.EDGE_TYPE_OUTLINE); Loading