aboutsummaryrefslogtreecommitdiffstats
path: root/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ManifestOrderDetectorTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ManifestOrderDetectorTest.java')
-rw-r--r--lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ManifestOrderDetectorTest.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ManifestOrderDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ManifestOrderDetectorTest.java
index 7513138..8d49bfa 100644
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ManifestOrderDetectorTest.java
+++ b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ManifestOrderDetectorTest.java
@@ -199,4 +199,37 @@ public class ManifestOrderDetectorTest extends AbstractCheckTest {
"duplicate-manifest-ignore.xml=>AndroidManifest.xml",
"res/values/strings.xml"));
}
+
+ public void testAllowBackup() throws Exception {
+ mEnabled = Collections.singleton(ManifestOrderDetector.ALLOW_BACKUP);
+ assertEquals(
+ "AndroidManifest.xml:9: Warning: Should explicitly set android:allowBackup to " +
+ "true or false (it's true by default, and that can have some security " +
+ "implications for the application's data) [AllowBackup]\n" +
+ " <application\n" +
+ " ^\n" +
+ "0 errors, 1 warnings\n",
+ lintProject(
+ "AndroidManifest.xml",
+ "res/values/strings.xml"));
+ }
+
+ public void testAllowBackupOk() throws Exception {
+ mEnabled = Collections.singleton(ManifestOrderDetector.ALLOW_BACKUP);
+ assertEquals(
+ "No warnings.",
+ lintProject(
+ "allowbackup.xml=>AndroidManifest.xml",
+ "res/values/strings.xml"));
+ }
+
+ public void testAllowIgnore() throws Exception {
+ mEnabled = Collections.singleton(ManifestOrderDetector.ALLOW_BACKUP);
+ assertEquals(
+ "No warnings.",
+ lintProject(
+ "allowbackup_ignore.xml=>AndroidManifest.xml",
+ "res/values/strings.xml"));
+ }
+
}