summaryrefslogtreecommitdiffstats
path: root/tests/backup/test_restore.sh
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2009-06-26 14:45:25 -0400
committerJoe Onorato <joeo@android.com>2009-06-26 14:45:25 -0400
commitdc355a90a3d9d34f66316928a53f61ac35ab4781 (patch)
tree7b9de72bba6ed97ff81b600073cbbed46a0cf7a1 /tests/backup/test_restore.sh
parentaae628b44518f0886a7f33b88c1131f47d853e70 (diff)
downloadframeworks_base-dc355a90a3d9d34f66316928a53f61ac35ab4781.zip
frameworks_base-dc355a90a3d9d34f66316928a53f61ac35ab4781.tar.gz
frameworks_base-dc355a90a3d9d34f66316928a53f61ac35ab4781.tar.bz2
Add a test for SharedPreferencesBackupHelper
(which nobody had ever tested. I like it when stuff just works the first time).
Diffstat (limited to 'tests/backup/test_restore.sh')
-rwxr-xr-xtests/backup/test_restore.sh19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/backup/test_restore.sh b/tests/backup/test_restore.sh
index f3d581e..ccf29cf 100755
--- a/tests/backup/test_restore.sh
+++ b/tests/backup/test_restore.sh
@@ -2,7 +2,7 @@
function check_file
{
- data=$(adb shell cat /data/data/com.android.backuptest/files/$1)
+ data=$(adb shell cat /data/data/com.android.backuptest/$1)
if [ "$data" = "$2" ] ; then
echo "$1 has correct value [$2]"
else
@@ -16,8 +16,12 @@ function check_file
echo --- Previous files
adb shell "ls -l /data/data/com.android.backuptest/files"
adb shell "rm /data/data/com.android.backuptest/files/*"
-echo --- Erased files
+echo --- Previous shared_prefs
+adb shell "ls -l /data/data/com.android.backuptest/shared_prefs"
+adb shell "rm /data/data/com.android.backuptest/shared_prefs/*"
+echo --- Erased files and shared_prefs
adb shell "ls -l /data/data/com.android.backuptest/files"
+adb shell "ls -l /data/data/com.android.backuptest/shared_prefs"
echo ---
echo
@@ -32,15 +36,18 @@ echo
echo
# check the results
-check_file file.txt "first file"
-check_file another_file.txt "asdf"
-check_file 3.txt "3"
-check_file empty.txt ""
+check_file files/file.txt "first file"
+check_file files/another_file.txt "asdf"
+check_file files/3.txt "3"
+check_file files/empty.txt ""
+check_file shared_prefs/raw.xml '<map><int name="pref" value="1" /></map>'
echo
echo
echo
echo --- Restored files
adb shell "ls -l /data/data/com.android.backuptest/files"
+echo --- Restored shared_prefs
+adb shell "ls -l /data/data/com.android.backuptest/shared_prefs"
echo ---
echo