Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: tests/standalone/io/raw_datagram_socket_test.dart

Issue 1381233003: Increase the datagram receive buffer on Windows to 64k (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Removed tabs Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/socket.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/raw_datagram_socket_test.dart
diff --git a/tests/standalone/io/raw_datagram_socket_test.dart b/tests/standalone/io/raw_datagram_socket_test.dart
index 9b952d6762882c597539673073ecfae6f48d1b9a..fd5495cc09666da4b6a0a3a28b98cf0a0e18e602 100644
--- a/tests/standalone/io/raw_datagram_socket_test.dart
+++ b/tests/standalone/io/raw_datagram_socket_test.dart
@@ -127,7 +127,8 @@ testBroadcast() {
asyncEnd();
}
}
- broadcastTimer = new Timer.periodic(new Duration(milliseconds: 10), send);
+ broadcastTimer =
+ new Timer.periodic(new Duration(milliseconds: 10), send);
});
}
@@ -194,7 +195,7 @@ testLoopbackMulticast() {
}
}
-testSendReceive(InternetAddress bindAddress) {
+testSendReceive(InternetAddress bindAddress, int dataSize) {
asyncStart();
var total = 1000;
@@ -218,7 +219,7 @@ testSendReceive(InternetAddress bindAddress) {
}
Uint8List createDataPackage(int seq) {
- var data = new Uint8List(1000);
+ var data = new Uint8List(dataSize);
(new ByteData.view(data.buffer, 0, 4)).setUint32(0, seq);
return data;
}
@@ -236,7 +237,7 @@ testSendReceive(InternetAddress bindAddress) {
// Send a datagram acknowledging the received sequence.
int bytes = sender.send(
createDataPackage(seq), bindAddress, receiver.port);
- Expect.isTrue(bytes == 0 || bytes == 1000);
+ Expect.isTrue(bytes == 0 || bytes == dataSize);
}
void sendAck(address, port) {
@@ -287,6 +288,7 @@ testSendReceive(InternetAddress bindAddress) {
var datagram = receiver.receive();
if (datagram != null) {
Expect.equals(datagram.port, sender.port);
+ Expect.equals(dataSize, datagram.data.length);
if (!bindAddress.isMulticast) {
Expect.equals(receiver.address, datagram.address);
}
@@ -318,6 +320,10 @@ main() {
}
testBroadcast();
testLoopbackMulticast();
- testSendReceive(InternetAddress.LOOPBACK_IP_V4);
- testSendReceive(InternetAddress.LOOPBACK_IP_V6);
+ testSendReceive(InternetAddress.LOOPBACK_IP_V4, 1000);
+ testSendReceive(InternetAddress.LOOPBACK_IP_V6, 1000);
+ testSendReceive(InternetAddress.LOOPBACK_IP_V4, 32 * 1024);
+ testSendReceive(InternetAddress.LOOPBACK_IP_V6, 32 * 1024);
+ testSendReceive(InternetAddress.LOOPBACK_IP_V4, 64 * 1024 - 32);
+ testSendReceive(InternetAddress.LOOPBACK_IP_V6, 64 * 1024 - 32);
}
« no previous file with comments | « sdk/lib/io/socket.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698