Loading res/values/strings.xml +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ <!-- Title of the Files application [CHAR LIMIT=32] --> <string name="files_label">Files</string> <!-- Title of the Downloads application, which sometimes Files is known as [CHAR LIMIT=32] --> <!-- Title of the Downloads application, which sometimes Files is known as [CHAR LIMIT=16] --> <string name="downloads_label">Downloads</string> <!-- Title of the documents application [CHAR LIMIT=32] --> Loading tests/unit/com/android/documentsui/prefs/PrefsBackupHelperTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.support.test.InstrumentationRegistry; import android.support.test.filters.SmallTest; import android.support.test.runner.AndroidJUnit4; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; Loading Loading @@ -54,9 +55,20 @@ public class PrefsBackupHelperTest { public void setUp() { mDefaultPrefs = InstrumentationRegistry.getContext().getSharedPreferences("prefs1", 0); mBackupPrefs = InstrumentationRegistry.getContext().getSharedPreferences("prefs2", 0); clearSharedPrefs(); mPrefsBackupHelper = new PrefsBackupHelper(mDefaultPrefs); } @After public void tearDown() { clearSharedPrefs(); } private void clearSharedPrefs() { mDefaultPrefs.edit().clear().commit(); mBackupPrefs.edit().clear().commit(); } @Test public void testPrepareBackupFile_BackupLocalPreferences() { mDefaultPrefs.edit().putInt(LOCAL_PREFERENCE_1, 1).commit(); Loading Loading
res/values/strings.xml +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ <!-- Title of the Files application [CHAR LIMIT=32] --> <string name="files_label">Files</string> <!-- Title of the Downloads application, which sometimes Files is known as [CHAR LIMIT=32] --> <!-- Title of the Downloads application, which sometimes Files is known as [CHAR LIMIT=16] --> <string name="downloads_label">Downloads</string> <!-- Title of the documents application [CHAR LIMIT=32] --> Loading
tests/unit/com/android/documentsui/prefs/PrefsBackupHelperTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.support.test.InstrumentationRegistry; import android.support.test.filters.SmallTest; import android.support.test.runner.AndroidJUnit4; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; Loading Loading @@ -54,9 +55,20 @@ public class PrefsBackupHelperTest { public void setUp() { mDefaultPrefs = InstrumentationRegistry.getContext().getSharedPreferences("prefs1", 0); mBackupPrefs = InstrumentationRegistry.getContext().getSharedPreferences("prefs2", 0); clearSharedPrefs(); mPrefsBackupHelper = new PrefsBackupHelper(mDefaultPrefs); } @After public void tearDown() { clearSharedPrefs(); } private void clearSharedPrefs() { mDefaultPrefs.edit().clear().commit(); mBackupPrefs.edit().clear().commit(); } @Test public void testPrepareBackupFile_BackupLocalPreferences() { mDefaultPrefs.edit().putInt(LOCAL_PREFERENCE_1, 1).commit(); Loading