Merge "Hide potentially invisible DO Disclosures by default"
This commit is contained in:
committed by
Android (Google) Code Review
commit
38931ed7c1
@@ -21,11 +21,14 @@ import android.content.Context;
|
||||
import com.android.settings.SettingsRobolectricTestRunner;
|
||||
import com.android.settings.TestConfig;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.annotation.Config;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
/**
|
||||
* Tests for {@link AdminActionPreferenceControllerBase}.
|
||||
*/
|
||||
@@ -47,6 +50,11 @@ public final class AdminActionPreferenceControllerBaseTest extends
|
||||
mDate = date;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsAvailable() {
|
||||
assertThat(mController.isAvailable()).isTrue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPreferenceKey() {
|
||||
return null;
|
||||
|
@@ -20,11 +20,13 @@ import com.android.settings.SettingsRobolectricTestRunner;
|
||||
import com.android.settings.TestConfig;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.annotation.Config;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
@@ -47,6 +49,11 @@ public final class BugReportsPreferenceControllerTest extends
|
||||
.thenReturn(date);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsAvailable() {
|
||||
assertThat(mController.isAvailable()).isTrue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPreferenceKey() {
|
||||
return "bug_reports";
|
||||
|
@@ -176,6 +176,24 @@ public final class EnterprisePrivacyFeatureProviderImplTest {
|
||||
assertThat(mProvider.getLastNetworkLogRetrievalTime()).isEqualTo(TIMESTAMP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsSecurityLoggingEnabled() {
|
||||
when(mDevicePolicyManager.isSecurityLoggingEnabled(null)).thenReturn(false);
|
||||
assertThat(mProvider.isSecurityLoggingEnabled()).isFalse();
|
||||
|
||||
when(mDevicePolicyManager.isSecurityLoggingEnabled(null)).thenReturn(true);
|
||||
assertThat(mProvider.isSecurityLoggingEnabled()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsNetworkLoggingEnabled() {
|
||||
when(mDevicePolicyManager.isNetworkLoggingEnabled(null)).thenReturn(false);
|
||||
assertThat(mProvider.isNetworkLoggingEnabled()).isFalse();
|
||||
|
||||
when(mDevicePolicyManager.isNetworkLoggingEnabled(null)).thenReturn(true);
|
||||
assertThat(mProvider.isNetworkLoggingEnabled()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsAlwaysOnVpnSetInPrimaryUser() {
|
||||
when(mConnectivityManger.getAlwaysOnVpnPackageForUser(MY_USER_ID)).thenReturn(null);
|
||||
|
@@ -20,11 +20,13 @@ import com.android.settings.SettingsRobolectricTestRunner;
|
||||
import com.android.settings.TestConfig;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.annotation.Config;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
@@ -47,6 +49,22 @@ public final class NetworkLogsPreferenceControllerTest extends
|
||||
.thenReturn(date);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsAvailable() {
|
||||
setDate(null);
|
||||
when(mFeatureFactory.enterprisePrivacyFeatureProvider.isNetworkLoggingEnabled())
|
||||
.thenReturn(false);
|
||||
assertThat(mController.isAvailable()).isFalse();
|
||||
|
||||
setDate(new Date());
|
||||
assertThat(mController.isAvailable()).isTrue();
|
||||
|
||||
setDate(null);
|
||||
when(mFeatureFactory.enterprisePrivacyFeatureProvider.isNetworkLoggingEnabled())
|
||||
.thenReturn(true);
|
||||
assertThat(mController.isAvailable()).isTrue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPreferenceKey() {
|
||||
return "network_logs";
|
||||
|
@@ -20,11 +20,13 @@ import com.android.settings.SettingsRobolectricTestRunner;
|
||||
import com.android.settings.TestConfig;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.annotation.Config;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
@@ -47,6 +49,22 @@ public final class SecurityLogsPreferenceControllerTest extends
|
||||
.thenReturn(date);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsAvailable() {
|
||||
setDate(null);
|
||||
when(mFeatureFactory.enterprisePrivacyFeatureProvider.isSecurityLoggingEnabled())
|
||||
.thenReturn(false);
|
||||
assertThat(mController.isAvailable()).isFalse();
|
||||
|
||||
setDate(new Date());
|
||||
assertThat(mController.isAvailable()).isTrue();
|
||||
|
||||
setDate(null);
|
||||
when(mFeatureFactory.enterprisePrivacyFeatureProvider.isSecurityLoggingEnabled())
|
||||
.thenReturn(true);
|
||||
assertThat(mController.isAvailable()).isTrue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPreferenceKey() {
|
||||
return "security_logs";
|
||||
|
Reference in New Issue
Block a user