refactor BackupOperation a bit, make more illegal states explicit

This commit is contained in:
Vincent Breitmoser
2016-05-17 21:13:41 +02:00
parent 1da8e4c1ed
commit 5d5d2c3c36
3 changed files with 127 additions and 62 deletions

View File

@@ -242,7 +242,6 @@ public class ExportTest {
@Test
public void testExportUnencrypted() throws Exception {
ContentResolver mockResolver = mock(ContentResolver.class);
Uri fakeOutputUri = Uri.parse("content://fake/out/1");
@@ -256,7 +255,7 @@ public class ExportTest {
new ProviderHelper(RuntimeEnvironment.application), null);
BackupKeyringParcel parcel = new BackupKeyringParcel(
new long[] { mStaticRing1.getMasterKeyId() }, false, fakeOutputUri);
new long[] { mStaticRing1.getMasterKeyId() }, false, false, fakeOutputUri);
ExportResult result = op.execute(parcel, null);
@@ -284,8 +283,6 @@ public class ExportTest {
@Test
public void testExportEncrypted() throws Exception {
Application spyApplication;
ContentResolver mockResolver = mock(ContentResolver.class);
@@ -315,7 +312,7 @@ public class ExportTest {
new ProviderHelper(RuntimeEnvironment.application), null);
BackupKeyringParcel parcel = new BackupKeyringParcel(
new long[] { mStaticRing1.getMasterKeyId() }, false, fakeOutputUri);
new long[] { mStaticRing1.getMasterKeyId() }, false, true, fakeOutputUri);
CryptoInputParcel inputParcel = new CryptoInputParcel(passphrase);
ExportResult result = op.execute(parcel, inputParcel);