frameworks-test: adding missing @SmallTest
This activates all frameworks-test tests in runs of the continuous platform tests. Test: $ runtest frameworks-net passes (expect Tether Bug: 32561414 Change-Id: Ib42c4ab2d7214891cd451875ca4bf6db195538c1
This commit is contained in:
@@ -70,7 +70,6 @@ import android.provider.Settings;
|
||||
import android.test.AndroidTestCase;
|
||||
import android.test.FlakyTest;
|
||||
import android.test.mock.MockContentResolver;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
import android.util.Log;
|
||||
import android.util.LogPrinter;
|
||||
@@ -195,6 +194,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
}
|
||||
|
||||
// Tests that IdleableHandlerThread works as expected.
|
||||
@SmallTest
|
||||
public void testIdleableHandlerThread() {
|
||||
final int attempts = 50; // Causes the test to take about 200ms on bullhead-eng.
|
||||
|
||||
@@ -219,6 +219,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@FlakyTest(tolerance = 3)
|
||||
public void testNotWaitingForIdleCausesRaceConditions() {
|
||||
// Bring up a network that we can use to send messages to ConnectivityService.
|
||||
@@ -842,7 +843,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
return cv;
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testLingering() throws Exception {
|
||||
verifyNoNetwork();
|
||||
mCellNetworkAgent = new MockNetworkAgent(TRANSPORT_CELLULAR);
|
||||
@@ -882,7 +883,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
verifyNoNetwork();
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testValidatedCellularOutscoresUnvalidatedWiFi() throws Exception {
|
||||
// Test bringing up unvalidated WiFi
|
||||
mWiFiNetworkAgent = new MockNetworkAgent(TRANSPORT_WIFI);
|
||||
@@ -917,7 +918,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
verifyNoNetwork();
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testUnvalidatedWifiOutscoresUnvalidatedCellular() throws Exception {
|
||||
// Test bringing up unvalidated cellular.
|
||||
mCellNetworkAgent = new MockNetworkAgent(TRANSPORT_CELLULAR);
|
||||
@@ -943,7 +944,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
verifyNoNetwork();
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testUnlingeringDoesNotValidate() throws Exception {
|
||||
// Test bringing up unvalidated WiFi.
|
||||
mWiFiNetworkAgent = new MockNetworkAgent(TRANSPORT_WIFI);
|
||||
@@ -971,7 +972,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
NET_CAPABILITY_VALIDATED));
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testCellularOutscoresWeakWifi() throws Exception {
|
||||
// Test bringing up validated cellular.
|
||||
mCellNetworkAgent = new MockNetworkAgent(TRANSPORT_CELLULAR);
|
||||
@@ -997,7 +998,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
verifyActiveNetwork(TRANSPORT_WIFI);
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testReapingNetwork() throws Exception {
|
||||
// Test bringing up WiFi without NET_CAPABILITY_INTERNET.
|
||||
// Expect it to be torn down immediately because it satisfies no requests.
|
||||
@@ -1030,7 +1031,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
waitFor(cv);
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testCellularFallback() throws Exception {
|
||||
// Test bringing up validated cellular.
|
||||
mCellNetworkAgent = new MockNetworkAgent(TRANSPORT_CELLULAR);
|
||||
@@ -1068,7 +1069,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
verifyActiveNetwork(TRANSPORT_WIFI);
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testWiFiFallback() throws Exception {
|
||||
// Test bringing up unvalidated WiFi.
|
||||
mWiFiNetworkAgent = new MockNetworkAgent(TRANSPORT_WIFI);
|
||||
@@ -1195,7 +1196,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testStateChangeNetworkCallbacks() throws Exception {
|
||||
final TestNetworkCallback genericNetworkCallback = new TestNetworkCallback();
|
||||
final TestNetworkCallback wifiNetworkCallback = new TestNetworkCallback();
|
||||
@@ -1578,7 +1579,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
handlerThread.quit();
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testNetworkFactoryRequests() throws Exception {
|
||||
tryNetworkFactoryRequests(NET_CAPABILITY_MMS);
|
||||
tryNetworkFactoryRequests(NET_CAPABILITY_SUPL);
|
||||
@@ -1598,7 +1599,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
// Skipping VALIDATED and CAPTIVE_PORTAL as they're disallowed.
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testNoMutableNetworkRequests() throws Exception {
|
||||
PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, new Intent("a"), 0);
|
||||
NetworkRequest.Builder builder = new NetworkRequest.Builder();
|
||||
@@ -1623,7 +1624,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
} catch (IllegalArgumentException expected) {}
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testMMSonWiFi() throws Exception {
|
||||
// Test bringing up cellular without MMS NetworkRequest gets reaped
|
||||
mCellNetworkAgent = new MockNetworkAgent(TRANSPORT_CELLULAR);
|
||||
@@ -1658,7 +1659,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
verifyActiveNetwork(TRANSPORT_WIFI);
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testMMSonCell() throws Exception {
|
||||
// Test bringing up cellular without MMS
|
||||
mCellNetworkAgent = new MockNetworkAgent(TRANSPORT_CELLULAR);
|
||||
@@ -1684,7 +1685,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
verifyActiveNetwork(TRANSPORT_CELLULAR);
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testCaptivePortal() {
|
||||
final TestNetworkCallback captivePortalCallback = new TestNetworkCallback();
|
||||
final NetworkRequest captivePortalRequest = new NetworkRequest.Builder()
|
||||
@@ -1733,7 +1734,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
validatedCallback.expectCallback(CallbackState.LOST, mWiFiNetworkAgent);
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testAvoidOrIgnoreCaptivePortals() {
|
||||
final TestNetworkCallback captivePortalCallback = new TestNetworkCallback();
|
||||
final NetworkRequest captivePortalRequest = new NetworkRequest.Builder()
|
||||
@@ -1804,7 +1805,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
execptionCalled);
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testRegisterDefaultNetworkCallback() throws Exception {
|
||||
final TestNetworkCallback defaultNetworkCallback = new TestNetworkCallback();
|
||||
mCm.registerDefaultNetworkCallback(defaultNetworkCallback);
|
||||
@@ -1865,7 +1866,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
@SmallTest
|
||||
public void testRequestCallbackUpdates() throws Exception {
|
||||
// File a network request for mobile.
|
||||
final TestNetworkCallback cellNetworkCallback = new TestRequestUpdateCallback();
|
||||
@@ -2458,6 +2459,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
|
||||
return mWiFiNetworkAgent.getNetwork();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testPacketKeepalives() throws Exception {
|
||||
InetAddress myIPv4 = InetAddress.getByName("192.0.2.129");
|
||||
InetAddress notMyIPv4 = InetAddress.getByName("192.0.2.35");
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.net.Network;
|
||||
import android.net.NetworkCapabilities;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.NetworkMisc;
|
||||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
import android.text.format.DateUtils;
|
||||
import com.android.internal.R;
|
||||
import com.android.server.ConnectivityService;
|
||||
@@ -70,6 +71,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
mMonitor = new TestableLingerMonitor(mCtx, mNotifier, HIGH_DAILY_LIMIT, HIGH_RATE_LIMIT);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testTransitions() {
|
||||
setNotificationSwitch(transition(WIFI, CELLULAR));
|
||||
NetworkAgentInfo nai1 = wifiNai(100);
|
||||
@@ -79,6 +81,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
assertFalse(mMonitor.isNotificationEnabled(nai2, nai1));
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testNotificationOnLinger() {
|
||||
setNotificationSwitch(transition(WIFI, CELLULAR));
|
||||
setNotificationType(LingerMonitor.NOTIFY_TYPE_NOTIFICATION);
|
||||
@@ -89,6 +92,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
verifyNotification(from, to);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testToastOnLinger() {
|
||||
setNotificationSwitch(transition(WIFI, CELLULAR));
|
||||
setNotificationType(LingerMonitor.NOTIFY_TYPE_TOAST);
|
||||
@@ -99,6 +103,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
verifyToast(from, to);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testNotificationClearedAfterDisconnect() {
|
||||
setNotificationSwitch(transition(WIFI, CELLULAR));
|
||||
setNotificationType(LingerMonitor.NOTIFY_TYPE_NOTIFICATION);
|
||||
@@ -112,6 +117,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
verify(mNotifier, times(1)).clearNotification(100);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testNotificationClearedAfterSwitchingBack() {
|
||||
setNotificationSwitch(transition(WIFI, CELLULAR));
|
||||
setNotificationType(LingerMonitor.NOTIFY_TYPE_NOTIFICATION);
|
||||
@@ -125,6 +131,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
verify(mNotifier, times(1)).clearNotification(100);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testUniqueToast() {
|
||||
setNotificationSwitch(transition(WIFI, CELLULAR));
|
||||
setNotificationType(LingerMonitor.NOTIFY_TYPE_TOAST);
|
||||
@@ -142,6 +149,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
verifyNoNotifications();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testMultipleNotifications() {
|
||||
setNotificationSwitch(transition(WIFI, CELLULAR));
|
||||
setNotificationType(LingerMonitor.NOTIFY_TYPE_NOTIFICATION);
|
||||
@@ -160,6 +168,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
verifyNotification(wifi2, cell);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testRateLimiting() throws InterruptedException {
|
||||
mMonitor = new TestableLingerMonitor(mCtx, mNotifier, HIGH_DAILY_LIMIT, LOW_RATE_LIMIT);
|
||||
|
||||
@@ -185,6 +194,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
verifyNoNotifications();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testDailyLimiting() throws InterruptedException {
|
||||
mMonitor = new TestableLingerMonitor(mCtx, mNotifier, LOW_DAILY_LIMIT, HIGH_RATE_LIMIT);
|
||||
|
||||
@@ -211,6 +221,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
verifyNoNotifications();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testUniqueNotification() {
|
||||
setNotificationSwitch(transition(WIFI, CELLULAR));
|
||||
setNotificationType(LingerMonitor.NOTIFY_TYPE_NOTIFICATION);
|
||||
@@ -227,6 +238,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
verifyNotification(from, to);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testIgnoreNeverValidatedNetworks() {
|
||||
setNotificationType(LingerMonitor.NOTIFY_TYPE_TOAST);
|
||||
setNotificationSwitch(transition(WIFI, CELLULAR));
|
||||
@@ -238,6 +250,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
verifyNoNotifications();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testIgnoreCurrentlyValidatedNetworks() {
|
||||
setNotificationType(LingerMonitor.NOTIFY_TYPE_TOAST);
|
||||
setNotificationSwitch(transition(WIFI, CELLULAR));
|
||||
@@ -249,6 +262,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
verifyNoNotifications();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testNoNotificationType() {
|
||||
setNotificationType(LingerMonitor.NOTIFY_TYPE_TOAST);
|
||||
setNotificationSwitch();
|
||||
@@ -259,6 +273,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
verifyNoNotifications();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testNoTransitionToNotify() {
|
||||
setNotificationType(LingerMonitor.NOTIFY_TYPE_NONE);
|
||||
setNotificationSwitch(transition(WIFI, CELLULAR));
|
||||
@@ -269,6 +284,7 @@ public class LingerMonitorTest extends TestCase {
|
||||
verifyNoNotifications();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testDifferentTransitionToNotify() {
|
||||
setNotificationType(LingerMonitor.NOTIFY_TYPE_TOAST);
|
||||
setNotificationSwitch(transition(CELLULAR, WIFI));
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.net.metrics.DnsEvent;
|
||||
import android.net.metrics.INetdEventListener;
|
||||
import android.net.metrics.IpConnectivityLog;
|
||||
import android.os.RemoteException;
|
||||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.junit.Before;
|
||||
@@ -83,6 +84,7 @@ public class NetdEventListenerServiceTest extends TestCase {
|
||||
verify(mCm, times(1)).registerNetworkCallback(any(), mCallbackCaptor.capture());
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testOneBatch() throws Exception {
|
||||
log(105, LATENCIES);
|
||||
log(106, Arrays.copyOf(LATENCIES, BATCH_SIZE - 1)); // one lookup short of a batch event
|
||||
@@ -97,6 +99,7 @@ public class NetdEventListenerServiceTest extends TestCase {
|
||||
new DnsEvent(106, EVENT_TYPES, RETURN_CODES, LATENCIES));
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testSeveralBatches() throws Exception {
|
||||
log(105, LATENCIES);
|
||||
log(106, LATENCIES);
|
||||
@@ -110,6 +113,7 @@ public class NetdEventListenerServiceTest extends TestCase {
|
||||
new DnsEvent(107, EVENT_TYPES, RETURN_CODES, LATENCIES));
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testBatchAndNetworkLost() throws Exception {
|
||||
byte[] eventTypes = Arrays.copyOf(EVENT_TYPES, 20);
|
||||
byte[] returnCodes = Arrays.copyOf(RETURN_CODES, 20);
|
||||
@@ -126,6 +130,7 @@ public class NetdEventListenerServiceTest extends TestCase {
|
||||
new DnsEvent(105, EVENT_TYPES, RETURN_CODES, LATENCIES));
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testConcurrentBatchesAndDumps() throws Exception {
|
||||
final long stop = System.currentTimeMillis() + 100;
|
||||
final PrintWriter pw = new PrintWriter(new FileOutputStream("/dev/null"));
|
||||
@@ -147,6 +152,7 @@ public class NetdEventListenerServiceTest extends TestCase {
|
||||
new DnsEvent(107, EVENT_TYPES, RETURN_CODES, LATENCIES));
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testConcurrentBatchesAndNetworkLoss() throws Exception {
|
||||
logAsync(105, LATENCIES);
|
||||
Thread.sleep(10L);
|
||||
|
||||
Reference in New Issue
Block a user