Add a new method to set state description

- This CL add a new method setSeekBarStateDescription() to set
  the state of seek bar. Because in some case the description of
  seek bar is not align progress of seek bar.
- Add test case

Bug: 157629483
Test: make -j42 RunSettingsRoboTests
Change-Id: I432e6f9deef59756b0a41244d50aaada1ddac6a9
This commit is contained in:
Hugh Chen
2020-06-05 15:00:45 +08:00
parent 9be31ce9ef
commit 2e5e04e79d
2 changed files with 24 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ package com.android.settings.widget;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.content.Context;
@@ -110,6 +111,13 @@ public class SeekBarPreferenceTest {
assertThat(seekBarPreference.isSelectable()).isTrue();
}
@Test
public void testSetSeekBarStateDescription() {
mSeekBarPreference.setSeekBarStateDescription("test");
verify(mSeekBarPreference).setSeekBarStateDescription("test");
}
public static class TestFragment extends PreferenceFragmentCompat {
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {