summaryrefslogtreecommitdiffstats
path: root/updater_sample/tests/src/com/example
diff options
context:
space:
mode:
authorZhomart Mukhamejanov <zhomart@google.com>2018-05-10 01:25:40 +0200
committerZhomart Mukhamejanov <zhomart@google.com>2018-05-17 18:29:57 +0200
commit238beb73739071735a6bcbe462e27ab09a747f02 (patch)
treec31c7704c28bd2a54cc077781a0ba8526be63b02 /updater_sample/tests/src/com/example
parentMerge "recovery: Refactor common setup into main()" (diff)
downloadandroid_bootable_recovery-238beb73739071735a6bcbe462e27ab09a747f02.tar
android_bootable_recovery-238beb73739071735a6bcbe462e27ab09a747f02.tar.gz
android_bootable_recovery-238beb73739071735a6bcbe462e27ab09a747f02.tar.bz2
android_bootable_recovery-238beb73739071735a6bcbe462e27ab09a747f02.tar.lz
android_bootable_recovery-238beb73739071735a6bcbe462e27ab09a747f02.tar.xz
android_bootable_recovery-238beb73739071735a6bcbe462e27ab09a747f02.tar.zst
android_bootable_recovery-238beb73739071735a6bcbe462e27ab09a747f02.zip
Diffstat (limited to 'updater_sample/tests/src/com/example')
-rw-r--r--updater_sample/tests/src/com/example/android/systemupdatersample/UpdateConfigTest.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/updater_sample/tests/src/com/example/android/systemupdatersample/UpdateConfigTest.java b/updater_sample/tests/src/com/example/android/systemupdatersample/UpdateConfigTest.java
index 0975e76be..000f5663b 100644
--- a/updater_sample/tests/src/com/example/android/systemupdatersample/UpdateConfigTest.java
+++ b/updater_sample/tests/src/com/example/android/systemupdatersample/UpdateConfigTest.java
@@ -18,6 +18,7 @@ package com.example.android.systemupdatersample;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
@@ -45,7 +46,8 @@ public class UpdateConfigTest {
private static final String JSON_NON_STREAMING =
"{\"name\": \"vip update\", \"url\": \"file:///builds/a.zip\", "
- + " \"ab_install_type\": \"NON_STREAMING\"}";
+ + " \"ab_install_type\": \"NON_STREAMING\","
+ + " \"ab_config\": { \"force_switch_slot\": false } }";
@Rule
public final ExpectedException thrown = ExpectedException.none();
@@ -82,6 +84,7 @@ public class UpdateConfigTest {
config.getStreamingMetadata().getPropertyFiles()[0].getFilename());
assertEquals(195, config.getStreamingMetadata().getPropertyFiles()[0].getOffset());
assertEquals(8, config.getStreamingMetadata().getPropertyFiles()[0].getSize());
+ assertTrue(config.getAbConfig().getForceSwitchSlot());
}
@Test
@@ -94,7 +97,8 @@ public class UpdateConfigTest {
@Test
public void getUpdatePackageFile_throwsErrorIfNotAFile() throws Exception {
String json = "{\"name\": \"upd\", \"url\": \"http://foo.bar\","
- + " \"ab_install_type\": \"NON_STREAMING\"}";
+ + " \"ab_install_type\": \"NON_STREAMING\","
+ + " \"ab_config\": { \"force_switch_slot\": false } }";
UpdateConfig config = UpdateConfig.fromJson(json);
thrown.expect(RuntimeException.class);
config.getUpdatePackageFile();