Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d1da05c authored by Stanislav Zholnin's avatar Stanislav Zholnin
Browse files

Modify DeviceConfigServiceTest to match actual DeviceConfig reset method behavior.

Test: atest SettingsProviderTest
Change-Id: I2c21f118e2822e2033b8e4394109242d4b1e1203
parent 7ae74313
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ public class DeviceConfigServiceTest {
        // make sValue the default value
        executeShellCommand(
                "device_config put " + sNamespace + " " + sKey + " " + sValue + " default");
        // make newValue the current value (as set by a trusted package)
        // make newValue the current value (as set by a untrusted package)
        executeShellCommand(
                "device_config put " + sNamespace + " " + sKey + " " + newValue);
        String result = getFromContentProvider(mContentResolver, sNamespace, sKey);
@@ -156,13 +156,7 @@ public class DeviceConfigServiceTest {
        // reset values that were set by untrusted packages
        executeShellCommand("device_config reset untrusted_defaults " + sNamespace);
        result = getFromContentProvider(mContentResolver, sNamespace, sKey);
        // the current value was set by a trusted package, so it's not reset
        assertEquals(newValue, result);

        // reset values that were set by untrusted or trusted packages
        executeShellCommand("device_config reset trusted_defaults " + sNamespace);
        result = getFromContentProvider(mContentResolver, sNamespace, sKey);
        // the default value has been restored
        // the current value was set by a untrusted package, so it's reset
        assertEquals(sValue, result);
    }