Merge "Hide memory setting in app detail unless dev option is on."
This commit is contained in:
committed by
Android (Google) Code Review
commit
09304ec2fd
@@ -16,12 +16,14 @@
|
||||
|
||||
package com.android.settings.development;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.provider.Settings;
|
||||
|
||||
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
||||
import com.android.settings.TestConfig;
|
||||
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -33,8 +35,6 @@ import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.annotation.Config;
|
||||
import org.robolectric.util.ReflectionHelpers;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
@RunWith(SettingsRobolectricTestRunner.class)
|
||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
||||
public class DevelopmentSettingsEnablerTest {
|
||||
@@ -52,6 +52,16 @@ public class DevelopmentSettingsEnablerTest {
|
||||
ReflectionHelpers.setField(mEnabler, "mDevelopmentPreferences", mDevelopmentPreferences);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void constructor_shouldInitEnabledState() {
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
|
||||
|
||||
mEnabler = new DevelopmentSettingsEnabler(mContext, null);
|
||||
|
||||
assertThat(mEnabler.getLastEnabledState()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onResume_shouldReadStateFromSettingProvider() {
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
|
Reference in New Issue
Block a user