AI 148665: Disabling a test that does not work as
expected on a device with a SIM. BUG=1657996 Automated import of CL 148665
This commit is contained in:
committed by
The Android Open Source Project
parent
9b825aa0ee
commit
25f963753e
@ -178,29 +178,35 @@ public class SocketTest extends TestCase {
|
|||||||
SocketChannel.open();
|
SocketChannel.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regression test for issue 1018016, connecting ignored a set timeout.
|
// Regression test for issue 1018016, connecting ignored a set timeout.
|
||||||
@LargeTest
|
//
|
||||||
public void testSocketSetSOTimeout() throws IOException {
|
// Disabled because test behaves differently depending on networking
|
||||||
Socket sock = new Socket();
|
// environment. It works fine in the emulator and one the device with
|
||||||
int timeout = 5000;
|
// WLAN, but when 3G comes into play, the possible existence of a
|
||||||
long start = System.currentTimeMillis();
|
// proxy makes it fail.
|
||||||
try {
|
//
|
||||||
sock.connect(new InetSocketAddress(NON_EXISTING_ADDRESS, 80), timeout);
|
// @LargeTest
|
||||||
} catch (SocketTimeoutException e) {
|
// public void testSocketSetSOTimeout() throws IOException {
|
||||||
// expected
|
// Socket sock = new Socket();
|
||||||
long delay = System.currentTimeMillis() - start;
|
// int timeout = 5000;
|
||||||
if (Math.abs(delay - timeout) > 1000) {
|
// long start = System.currentTimeMillis();
|
||||||
fail("timeout was not accurate. expected: " + timeout
|
// try {
|
||||||
+ " actual: " + delay + " miliseconds.");
|
// sock.connect(new InetSocketAddress(NON_EXISTING_ADDRESS, 80), timeout);
|
||||||
}
|
// } catch (SocketTimeoutException e) {
|
||||||
} finally {
|
// // expected
|
||||||
try {
|
// long delay = System.currentTimeMillis() - start;
|
||||||
sock.close();
|
// if (Math.abs(delay - timeout) > 1000) {
|
||||||
} catch (IOException ioe) {
|
// fail("timeout was not accurate. expected: " + timeout
|
||||||
// ignore
|
// + " actual: " + delay + " miliseconds.");
|
||||||
}
|
// }
|
||||||
}
|
// } finally {
|
||||||
}
|
// try {
|
||||||
|
// sock.close();
|
||||||
|
// } catch (IOException ioe) {
|
||||||
|
// // ignore
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Regression test for 1062928: Dotted IP addresses (e.g., 192.168.100.1)
|
* Regression test for 1062928: Dotted IP addresses (e.g., 192.168.100.1)
|
||||||
|
Reference in New Issue
Block a user