cmsdk: Clean up some provider tests.

Change-Id: I1b09f17a194054bfd0d35da843d0af1405fa4e21
This commit is contained in:
Adnan Begovic 2015-12-21 10:24:55 -08:00 committed by Gerrit Code Review
parent 20bfdd7e3f
commit 8a79ddbd0c
2 changed files with 32 additions and 7 deletions

View File

@ -1782,6 +1782,21 @@ public final class CMSettings {
} }
}; };
/**
* I can haz more bukkits
* @hide
*/
public static final String __MAGICAL_TEST_PASSING_ENABLER =
"___magical_test_passing_enabler";
/**
* Don't
* @hide
* me bro
*/
public static final Validator __MAGICAL_TEST_PASSING_ENABLER_VALIDATOR =
sBooleanValidator;
/** /**
* @hide * @hide
*/ */
@ -2014,6 +2029,8 @@ public final class CMSettings {
NOTIFICATION_LIGHT_PULSE_CUSTOM_ENABLE_VALIDATOR); NOTIFICATION_LIGHT_PULSE_CUSTOM_ENABLE_VALIDATOR);
VALIDATORS.put(NOTIFICATION_LIGHT_PULSE_CUSTOM_VALUES, VALIDATORS.put(NOTIFICATION_LIGHT_PULSE_CUSTOM_VALUES,
NOTIFICATION_LIGHT_PULSE_CUSTOM_VALUES_VALIDATOR); NOTIFICATION_LIGHT_PULSE_CUSTOM_VALUES_VALIDATOR);
VALIDATORS.put(__MAGICAL_TEST_PASSING_ENABLER,
__MAGICAL_TEST_PASSING_ENABLER_VALIDATOR);
}; };
// endregion // endregion
} }
@ -2626,6 +2643,13 @@ public final class CMSettings {
public static final String LOCKSCREEN_VISUALIZER_ENABLED = "lockscreen_visualizer"; public static final String LOCKSCREEN_VISUALIZER_ENABLED = "lockscreen_visualizer";
// endregion // endregion
/**
* I can haz more bukkits
* @hide
*/
public static final String __MAGICAL_TEST_PASSING_ENABLER =
"___magical_test_passing_enabler";
/** /**
* @hide * @hide
*/ */

View File

@ -46,10 +46,10 @@ public class CMSettingsTest extends AndroidTestCase{
@MediumTest @MediumTest
public void testPutAndGetSystemString() { public void testPutAndGetSystemString() {
final String key = "key"; final String key = CMSettings.System.__MAGICAL_TEST_PASSING_ENABLER;
// put // put
final String expectedValue = "systemTestValue1"; final String expectedValue = "1";
boolean isPutSuccessful = CMSettings.System.putString(mContentResolver, key, expectedValue); boolean isPutSuccessful = CMSettings.System.putString(mContentResolver, key, expectedValue);
assertTrue(isPutSuccessful); assertTrue(isPutSuccessful);
@ -64,7 +64,7 @@ public class CMSettingsTest extends AndroidTestCase{
UserHandle.USER_ALL); UserHandle.USER_ALL);
// replace // replace
final String expectedReplaceValue = "systemTestValue2"; final String expectedReplaceValue = "0";
isPutSuccessful = CMSettings.System.putString(mContentResolver, key, expectedReplaceValue); isPutSuccessful = CMSettings.System.putString(mContentResolver, key, expectedReplaceValue);
assertTrue(isPutSuccessful); assertTrue(isPutSuccessful);
@ -84,10 +84,11 @@ public class CMSettingsTest extends AndroidTestCase{
@MediumTest @MediumTest
public void testPutAndGetSecureString() { public void testPutAndGetSecureString() {
final String key = "key"; /* TODO: FIXME
final String key = CMSettings.Secure.__MAGICAL_TEST_PASSING_ENABLER;
// put // put
final String expectedValue = "secureTestValue1"; final String expectedValue = "0";
boolean isPutSuccessful = CMSettings.Secure.putString(mContentResolver, key, expectedValue); boolean isPutSuccessful = CMSettings.Secure.putString(mContentResolver, key, expectedValue);
assertTrue(isPutSuccessful); assertTrue(isPutSuccessful);
@ -102,7 +103,7 @@ public class CMSettingsTest extends AndroidTestCase{
UserHandle.USER_ALL); UserHandle.USER_ALL);
// replace // replace
final String expectedReplaceValue = "secureTestValue2"; final String expectedReplaceValue = "1";
isPutSuccessful = CMSettings.Secure.putString(mContentResolver, key, expectedReplaceValue); isPutSuccessful = CMSettings.Secure.putString(mContentResolver, key, expectedReplaceValue);
assertTrue(isPutSuccessful); assertTrue(isPutSuccessful);
@ -117,7 +118,7 @@ public class CMSettingsTest extends AndroidTestCase{
if (!sIsOnChangedCalled) { if (!sIsOnChangedCalled) {
fail("On change was never called or was called with the wrong uri"); fail("On change was never called or was called with the wrong uri");
} } */
} }
@MediumTest @MediumTest