Merge "Ignore broken tests, fix flaky tests."

This commit is contained in:
Jeff Sharkey
2019-08-30 18:53:09 +00:00
committed by Android (Google) Code Review
3 changed files with 30 additions and 7 deletions

View File

@@ -4,17 +4,21 @@
"name": "CtsProviderTestCases",
"options": [
{
"include-annotation": "android.platform.test.annotations.Presubmit"
"exclude-filter": "android.provider.cts.SettingsPanelTest"
}
]
},
{
"name": "SettingsProviderTest",
"options": [
{
"include-annotation": "android.platform.test.annotations.Presubmit"
}
]
"name": "CalendarProviderTests"
},
{
"name": "ContactsProviderTests"
},
{
"name": "MediaProviderTests"
},
{
"name": "SettingsProviderTest"
}
]
}

View File

@@ -30,6 +30,7 @@ import android.database.Cursor;
import android.database.MatrixCursor;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.test.mock.MockContentProvider;
import android.test.mock.MockContentResolver;
@@ -47,6 +48,7 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
@@ -270,5 +272,17 @@ public class SettingsBackupAgentTest extends BaseSettingsProviderTest {
}
return result;
}
@Override
public Bundle call(String method, String request, Bundle args) {
for (Object[] resultRow : RESULT_ROWS) {
if (Objects.equals(request, resultRow[0])) {
final Bundle res = new Bundle();
res.putString("value", String.valueOf(resultRow[1]));
return res;
}
}
return Bundle.EMPTY;
}
}
}

View File

@@ -33,6 +33,7 @@ import android.os.UserHandle;
import android.provider.Settings;
import android.util.Log;
import org.junit.Ignore;
import org.junit.Test;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -693,6 +694,7 @@ public class SettingsProviderTest extends BaseSettingsProviderTest {
}
@Test
@Ignore("b/140250974")
public void testLocationModeChanges_viaFrontEndApi() throws Exception {
setStringViaFrontEndApiSetting(
SETTING_TYPE_SECURE,
@@ -735,6 +737,7 @@ public class SettingsProviderTest extends BaseSettingsProviderTest {
}
@Test
@Ignore("b/140250974")
public void testLocationProvidersAllowed_disableProviders() throws Exception {
setStringViaFrontEndApiSetting(
SETTING_TYPE_SECURE,
@@ -766,6 +769,7 @@ public class SettingsProviderTest extends BaseSettingsProviderTest {
}
@Test
@Ignore("b/140250974")
public void testLocationProvidersAllowed_enableAndDisable() throws Exception {
setStringViaFrontEndApiSetting(
SETTING_TYPE_SECURE,
@@ -788,6 +792,7 @@ public class SettingsProviderTest extends BaseSettingsProviderTest {
}
@Test
@Ignore("b/140250974")
public void testLocationProvidersAllowedLocked_invalidInput() throws Exception {
setStringViaFrontEndApiSetting(
SETTING_TYPE_SECURE,